Built-In Memory Diagnostic Tool

The built-in memory diagnostic tool is an internal tool for recording or dumping the memory allocated. Users can analyze if there was a memory leak or double freeing (freeing memory more than once) of the information record.

Use the following command in the shell environment to use the built-in memory diagnostic tool:

padinfo -p pid option

Using the Built-in Memory Diagnostic Tool Command

Command Parameters

Command Parameter Description
padinfo -p pid Process ID
option

-d enable|disable|enable-xx[,enable-yy]|disable-xx[,disable-yy]

enable: Enable memory leak debug

enable-xx[,enable-yy]: Enable further debug option, at present support: history

disable: disable all memory debug

disable-xx[,yy]: disable further debug option

-s uclibc|leak|history|all Show memory statistic information of uclibc or memory leak statistic debug information or flush history record or all.
-c n Show top n allocations (by default 50) when dumping memory leak statistic debug information.
-l n[,m,o] Set pointers (maximum limit), backtrace (maximum line limit), and history

n: maximum limit for pointers

m: maximum line limit of backtrace

o: history items per file

The set is not supported dynamically.
-u Show memory debug status (enabled or disabled)
-r Delete the storage directory when the debug function is disabled

Following is an example to show the memory statistic information of uclibc, memory leak statistic debug information, and flush history record.

ruckus$ padinfo –p 1204 -s all
send msg failed:errno =111: correction refused
ruckus$ padinfo -p 1124 -s all
memory statistic info of uclibc:
    total bytes allocated            =   70553600
    total bytes in use               =   26452872
    total bytes freed                =   44100728
    total allocated mmap space       =     311296
    number of free chunks            =      22794
    number of fastbin blocks         =        165
    space in freed fastbin blocks    =       7008

memory leak statistic debug info:
top 50 allocations:
  caller [icxd_snmp.c]  line[4689] size[476] allocation:[64], mem_size[30464]
  caller [icxd_snmp.c]  line[3957] size[28] allocation:[10], mem_size[280]

Following is an example to show the maximum limit for pointers, backtrace, and history items.

ruckus$ padinfo –p 1124 -d enable -l 20480 10240 20480
target process memory debug is enable(further options:callchain.plugin)
The Active limitation of record is pointer items[20480], backtrace items[10240], History items[20480]

Following is an example to show the memory debug status (enabled or disabled).

ruckus$ padinfo –u
ruckus$padinfo –p 1204 -u

Following is an example to delete the storage directory when the debug function is disabled.

ruckus$ padinfo –r
ruckus$padinfo –p 1204 -r