Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Check Overall CPU and Memory Usage

    Purpose

    You can display exhaustive system process information about software processes that are running on the router and have controlling terminals. This command is equivalent to the UNIX top command. However, the UNIX top command shows real-time memory usage, with the memory values constantly changing, while the show system processes extensive command provides a snapshot of memory usage in a given moment.

    Action

    To check overall CPU and memory usage, enter the following Junos OS command-line interface (CLI) command:

    user@host> show system processes extensive

    Sample Output

    user@R1> show system processes extensive
    last pid:  5251;  load averages:  0.00,  0.00,  0.00  up 4+20:22:16    10:44:41
    58 processes:  1 running, 57 sleeping
    Mem: 57M Active, 54M Inact, 17M Wired, 184K Cache, 35M Buf, 118M Free
    Swap:  512M Total, 512M Free
      PID USERNAME PRI NICE  SIZE    RES STATE    TIME   WCPU    CPU COMMAND
     4480 root       2   0  3728K  1908K select 231:17  2.34%  2.34% chassisd
     4500 root       2   0  1896K   952K select   0:36  0.00%  0.00% fud
     4505 root       2   0  1380K   736K select   0:35  0.00%  0.00% irsd
     4481 root       2   0  1864K   872K select   0:32  0.00%  0.00% alarmd
      4488 root       2   0  8464K  4600K kqread   0:28  0.00%  0.00% rpd
     4501 root       2 -15  1560K   968K select   0:21  0.00%  0.00% ppmd
     4510 root       2   0  1372K   812K select   0:13  0.00%  0.00% bfdd
        5 root      18   0     0K     0K syncer   0:09  0.00%  0.00% syncer
     4485 root       2   0  3056K  1776K select   0:07  0.00%  0.00% snmpd
     4499 root       2   0  3688K  1676K select   0:05  0.00%  0.00% kmd
     4486 root       2   0  3760K  1748K select   0:05  0.00%  0.00% mib2d
     4493 root       2   0  1872K   928K select   0:03  0.00%  0.00% pfed
     4507 root       2   0  1984K  1052K select   0:02  0.00%  0.00% fsad
     4518 root       2   0  3780K  2400K select   0:02  0.00%  0.00% dcd
        8 root     -18   0     0K     0K psleep   0:02  0.00%  0.00% vmuncachedaemo
        4 root     -18   0     0K     0K psleep   0:02  0.00%  0.00% bufdaemon
     4690 root       2   0     0K     0K peer_s   0:01  0.00%  0.00% peer proxy
     4504 root       2   0  1836K   968K select   0:01  0.00%  0.00% dfwd
     4477 root       2   0   992K   320K select   0:01  0.00%  0.00% watchdog
     4354 root       2   0  1116K   604K select   0:01  0.00%  0.00% syslogd
     4492 root      10   0  1004K   400K nanslp   0:01  0.00%  0.00% tnp.sntpd
     4446 root      10   0  1108K   616K nanslp   0:01  0.00%  0.00% cron
     4484 root       2   0 15716K  7468K select   0:01  0.00%  0.00% mgd
     4494 root       2  15  2936K  2036K select   0:01  0.00%  0.00% sampled
     5245 remote     2   0  8340K  3472K select   0:01  0.00%  0.00% cli
        2 root     -18   0     0K     0K psleep   0:00  0.00%  0.00% pagedaemon
     4512 root       2   0  2840K  1400K select   0:00  0.00%  0.00% l2tpd
        1 root      10   0   852K   580K wait     0:00  0.00%  0.00% init
     5244 root       2   0  1376K   784K select   0:00  0.00%  0.00% telnetd
     4509 root      10   0  1060K   528K nanslp   0:00  0.00%  0.00% eccd
     4508 root       2   0  2264K  1108K select   0:00  0.00%  0.00% spd
     2339 root      10   0   514M 17260K mfsidl   0:00  0.00%  0.00% newfs
     4497 root       2   0  2432K  1152K select   0:00  0.00%  0.00% cosd
     4490 root       2 -15  2356K  1020K select   0:00  0.00%  0.00% apsd
     4496 root       2   0  2428K  1108K select   0:00  0.00%  0.00% rmopd
     4491 root       2   0  2436K  1104K select   0:00  0.00%  0.00% vrrpd
     4487 root       2   0 15756K  7648K sbwait   0:00  0.00%  0.00% mgd
     5246 root       2   0 15776K  8336K select   0:00  0.00%  0.00% mgd
        0 root     -18   0     0K     0K sched    0:00  0.00%  0.00% swapper
      5251 root      30   0 21732K   840K RUN      0:00  0.00%  0.00% top
     4511 root       2   0  1964K   908K select   0:00  0.00%  0.00% pgmd
     4502 root       2   0  1960K   956K select   0:00  0.00%  0.00% lmpd
     4495 root       2   0  1884K   876K select   0:00  0.00%  0.00% ilmid
     4482 root       2   0  1772K   776K select   0:00  0.00%  0.00% craftd
     4503 root      10   0  1040K   492K nanslp   0:00  0.00%  0.00% smartd
        6 root      28   0     0K     0K sleep    0:00  0.00%  0.00% netdaemon
     4498 root       2   0  1736K   932K select   0:00  0.00%  0.00% nasd
     4506 root       2   0  1348K   672K select   0:00  0.00%  0.00% rtspd
     4489 root       2   0  1160K   668K select   0:00  0.00%  0.00% inetd
     4478 root       2   0  1108K   608K select   0:00  0.00%  0.00% tnetd
     4483 root       2   0  1296K   540K select   0:00  0.00%  0.00% ntpd
     4514 root       3   0  1080K   540K ttyin    0:00  0.00%  0.00% getty
     4331 root       2   0   416K   232K select   0:00  0.00%  0.00% pccardd
        7 root       2   0     0K     0K pfeacc   0:00  0.00%  0.00% if_pfe_listen
       11 root       2   0     0K     0K picacc   0:00  0.00%  0.00% if_pic_listen
        3 root      18   0     0K     0K psleep   0:00  0.00%  0.00% vmdaemon
        9 root       2   0     0K     0K scs_ho   0:00  0.00%  0.00% scs_housekeepi
       10 root       2   0     0K     0K cb-pol   0:00  0.00%  0.00% cb_poll
    

    Meaning

    The sample output shows the amount of virtual memory used by the Routing Engine and software processes. For example, 118 MB of physical memory is free and 512 MB of the swap file is free, indicating that the router is not short of memory. The processes field shows that most of the 58 processes are in the sleeping state, with 1 in the running state. The process or command that is running is the top command.

    The commands column lists the processes that are currently running. For example, the chassis process (chassisd) has a process identifier (PID) of 4480, with a current priority (PRI) of 2. A lower priority number indicates a higher priority.

    The processes are listed according to level of activity, with the most active process at the top of the output. For example, the chassis (chassisd) process is consuming the largest amount of CPU resource at 2.34 percent.

    The memory field (Mem) shows the virtual memory managed by the Routing Engine and used by processes. The value in the memory field is in KB and MB, and is broken down as follows:

    • Active—Memory that is allocated and actually in use by programs.
    • Inact—Memory that is either allocated but not recently used or memory that was freed by programs. Inactive memory is still mapped in the address space of one or more processes and, therefore, counts toward the resident set size of those processes.
    • Wired—Memory that is not eligible to be swapped, and is usually used for Routing Engine memory structures or memory physically locked by a process.
    • Cache—Memory that is not associated with any program and does not need to be swapped before being reused.
    • Buf—The size of the memory buffer used to hold data recently called from disk.
    • Free—Memory that is not associated with any programs. Memory freed by a process can become Inactive, Cache, or Free, depending on the method used by the process to free the memory.

    When the system is under memory pressure, the pageout process reuses memory from the free, cache, inactive and, if necessary, active pages.

    The Swap field shows the total swap space available and how much is unused. In the example, the output shows 512 MB of total swap space and 512 MB of free swap space.

    Finally, the memory usage of each process is listed. The SIZE field indicates the size of the virtual address space, and the RES field indicates the amount of the program in physical memory, which is also known as RSS or Resident Set Size. In the sample output, the chassis (chassisd) process has 3728 KB of virtual address space and 1908 KB of physical memory.

    For additional information about the show system processes extensive command, see Stopping and Starting Junos OS.

    Published: 2012-06-27