Can't find what you need?

• Ask the Community
• Create a Case
Reset Search



How to monitor and detect memory leaks in real-time?

« Go Back


TitleHow to monitor and detect memory leaks in real-time?
  • How do you collect memory dumps for specific processes using the mptool command?
  • NOS
You may monitor the memory usage of the process by using the following steps in all the nodes in the fabric:

As an example we use l2sysd as the process consuming memory.


Find the PID of the l2sysd

sw0:root> ps -ef | grep l2sysd
root 2884 2158 0 Oct04 ? 00:00:01 l2sysd -S ethsw -s 1

Configure mptool with snapshot mode:

sw0:root> mptool --config 2884 -m 1

Enabling the mptool .

sw0:root> mptool --mtrace 2884
MP enabled for PID 2884

Collect the mp dumps:
  • After letting the trace run for an hour or two perform a memory dump

sw0:root> mptool --memdump 2884
  • At the completion of this command a time stamped snapshot file will be located in /var/log/mp_snapdump_[PID]_[TIMESTAMP]
It is recommended to collect multiple dumps throughout the course of the day in order to identify trends with memory usage

Once the collection is done, disable the mtrace.

sw0:root> mptool --unmtrace 2884
MP disabled for PID 2884

Use FTP/SCP to transfer the collected dump files off of the switch
The Memory dump (mp_snampdump_xx) can be deleted from the VDX once it is uploaded to TAC.
Additional notes
Please don't enable this mptool on nodes which are already close to Maximum memory usage ( >80%)
It is recommended to enable on the nodes which are at normal usage level and observing seeing memory growth continuously.
Keep an eye on the memory growth and reboot the node to recover if needed
Also as we require root access to do these steps, it is recommended to work directly with TAC to perform this operation



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255