Skip to main content
tana
Staff
Staff
June 2, 2022

Technical Tip: CLI command 'diagnose sys top-mem'

  • June 2, 2022
  • 0 replies
  • 11631 views
Description

 

This article describes how to use thediagnose sys top-memcommand from the CLI prompt.

 

Scope

 

FortiGate.

 

Solution

 

This command displays processes with the most used memory (default 5 processes).

This command is very helpful in identifying the top processes that consume the most memory, especially when the FortiGate is in conserve mode or has a higher memory usage.

It also shows the total usage of the top processes. If none of the top processes are particularly high in memory usage there might be a processes which is spawned endlessly and memory increases this way.

 

Example output:

 

diagnose sys top-mem

node (165): 44189kB
forticron (173): 29644kB
ipshelper (227): 24577kB
cmdbsvr (142): 20290kB
miglogd (182): 12413kB
Top-5 memory used: 131113kB

 

diagnose sys top-mem 10
node (165): 44861kB
forticron (173): 29612kB
ipshelper (227): 24742kB
cmdbsvr (142): 20263kB
miglogd (182): 12405kB
cw_acd (210): 10705kB
miglogd (245): 7202kB
forticldd (174): 7042kB
dnsproxy (225): 6951kB
nsm (149): 6461kB
Top-10 memory used: 170244kB

 

The command understands different parameters.

 

diagnose sys top-mem

[process-count] Number of processes to include info for (default 5).

detail Display per-process memory info along with details (default 5 processes).

 

To list only the top 99 processes using the most memory:

 

diagnose sys top-mem 99

 

This command will show the sum of all 99 processes at the bottom of the list. This value should be close to what is visible under get hardware memory under Active. If it is not, there may be an issue where FortiOS spawns lots of duplicate processes, which slowly consumes all available memory.

 

To list more details for each process, use the 'detail' parameter:

 

diagnose sys top-mem detail

 

To list more details and specify the number of processes to list:

 

diagnose sys top-mem detail 99

 

Visit the related article below and refer to the following article to check which process is consuming high quantities of memory through the FortiGate GUI: Technical Tip: How to view, verify and kill the processes consuming more memory in the GUI.

 

Related article:

Troubleshooting Tip: How to do initial troubleshooting of high memory utilization issues (conserve mode)