The Class Of Service (CoS) process (cosd) could not dynamically allocate memory, for the indicated reason.
The COSD_MALLOC_FAILED message is logged each time the cosd process receives a failed response in an attempt to allocate memory.
When cosd receives a failed response in its attempt to obtain a memory allocation, it logs the action into the syslog. Below are several examples of the message:
sec=cosd[: COSD_MALLOC_FAILED: cosd_rtm_classifier: malloc failed: Cannot allocate memory
sec=cosd[: COSD_MALLOC_FAILED: cosd_rtm_rewrite: malloc failed: Cannot allocate memory
sec=cosd[: COSD_MALLOC_FAILED: cosd_rtm_scheduler_map: malloc failed: Cannot allocate memory
cosd: COSD_MALLOC_FAILED: malloc failed: Cannot allocate memory
The cause for such a notification may be due to a software bug causing a memory leak or the Routing Engine not having sufficient memory.
Review the output of the following commands:
show log cosd
show log messages
show system virtual-memory
show system processes extensive
The log files might show other events or process activity, such as a commit being done that would cause a shortage of memory to be available. The system outputs provide information on the memory usage by kernel and Junos processes respectively. These can be repeated over several time intervals to see if a particular process is increasing its memory usage elsewhere.
Follow these steps to help in troubleshooting this issue:
- Examine the log messages output to see if other events may have been occurring, such as a commit, that would cause a temporary shortage of memory.
- Check the system processes and virtual-memory outputs, which may need to be taken several times, to see if a process is increasing its memory usage over time.
- If possible, reset the Routing Engine to force all the processes to restart their memory queue allocations.
- If the memory allocation messages still continue to be generated at this point, open a case with your technical support representative to investigate the issue further.