Knowledge Search


×
 

[MX] How to verify the memory limitation for each process

  [KB31522] Show Article Properties


Summary:

This article provides an example of how to verify the memory limitation for each process.

Solution:

An explanation of how to check for the Routing CPU Memory Usage is documented here:
https://www.juniper.net/documentation/en_US/junos/topics/task/verification/routing-engine--memory-introduction.html

To identify the memory limitation, view the RLIMIT (resource limit). This is used to specify the hard and soft limits.

Please note that when a soft limit is exceeded, a process may receive a signal (for example, if the CPU time or file size is exceeded), but it will be allowed to continue execution until it reaches the hard limit (or modifies its resource limit parameter).

The show system process extensive command is used to check the current memory utilization for each process. It reports on two things:

  • SIZE: Total size of the process (text, data, and stack), in kilobytes.
  • RES:  Current amount of program resident memory, in kilobytes.

This is also known as RSS or Resident Set Size. The RES value includes shared library pages used by the process. Any amount of memory freed by the process might still be considered part of the RES value. Generally, the kernel delays the migrating of memory out of the Inact queue into the Cache or Free list unless there is a memory shortage.

This can lead to large discrepancies between the values reported by the routing protocol process and the kernel, even after the routing protocol process has freed a large amount of memory.

For example, in the output below, the chassisd PID is 1630.

user@router> show system processes extensive
last pid:  6753;  load averages:  0.02,  0.04,  0.00  up 0+18:40:43    06:56:39
154 processes: 3 running, 137 sleeping, 14 waiting
 
Mem: 582M Active, 128M Inact, 78M Wired, 253M Cache, 69M Buf, 2196M Free
Swap: 8192M Total, 8192M Free
 
1630 root   2   8  -88   123M 19664K nanslp  37:56  2.88% chassisd >> chassisd PID is 1630

Then perform the following to check it's rlimit:

user@router> file show /proc/1630/rlimit
cpu -1 -1
fsize -1 -1
data 34359738368 34359738368 >> 34359738368 is soft limit and  34359738368 is hard limit
stack 16777216 16777216
core -1 -1
rss 67108864 33268023296
memlock 67108864 33268023296
nproc 512 512
nofile 1024 1024
sbsize -1 -1
vmem -1 -1
npts -1 -1
swap -1 -1

 

Related Links: