xmemck — Enduro/X Memory Checker-leak detector
xmemck tool is used internally by Enduro/X testing suite. The tool is started before running XATMI level tests. The tool scans the process memory usage over the time. When scanned processes are finished, tool takes some range of the Virtual Memory (VSZ) and Resident Memory (RSS) values of the snapshots (made at certain intervals) and compares average of the first halve with average of the second halve. If the increase in second halve are bigger then defined percentage, then memory leak is reported for the binary.
The monitored binaries are selected by regular expressions passed to the command line. Also for different expressions different percentage settings can be used with different monitoring parameters. The command line arguments might be repeated thus at every -m the new monitoring set is produced. For monitoring processes are selected by ps -ef output matched against regexp.
Also it is possible to disable some keywords by regular expressions too. The xmemck can be terminated with SIGTERM.
Sample run of the binary:
$ xmemck -v20 -d30 -s60 -t95 -n 'atmiunit1|tpbridge|tmsrv' -m atmi -d70 -m tpbridge -m tmsrv 2>./memck.log 1>./memck.out &
The given example monitors following:
When leak is detected, the following infos is printed to stdout:
>>> LEAK pid=8605! rss: 21766 -> 32712 (+33.461727%), vsz 25412 -> 36337 (+30.065773%): [mvitolin 8605 7319 0 22:05 pts/17 00:00:00 ./a.out]