Back to home page

Enduro/X

 
 

    


0001 XMEMCK(8)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 xmemck - Enduro/X Memory Checker-leak detector
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 *xmemck* ['OPTIONS']
0014 
0015 
0016 DESCRIPTION
0017 -----------
0018 *xmemck* tool is used internally by Enduro/X testing suite. The tool is started
0019 before running XATMI level tests. The tool scans the process memory usage over
0020 the time. When scanned processes are finished, tool takes some range of the
0021 Virtual Memory (VSZ) and Resident Memory (RSS) values of the snapshots (made at
0022 certain intervals) and compares average of the first halve with average of the
0023 second halve. If the increase in second halve are bigger then defined percentage,
0024 then memory leak is reported for the binary.
0025 
0026 The monitored binaries are selected by regular expressions passed to the command
0027 line. Also for different expressions different percentage settings can be used with
0028 different monitoring parameters. The command line arguments might be repeated
0029 thus at every '-m' the new monitoring set is produced. For monitoring processes
0030 are selected by 'ps -ef' output matched against regexp.
0031 
0032 Also it is possible to disable some keywords by regular expressions too. The *xmemck*
0033 can be terminated with SIGTERM.
0034 
0035 OPTIONS
0036 -------
0037 [*-p*] 'PERIOID'::
0038 Number of seconds to scan for new processes and read existing processes VSZ and RSS.
0039 Default is *1* second.
0040 
0041 [*-d*] 'INCREASE_DELTA_ALLOW'::
0042 This is percentage to allow to increase between to halve average memory usage.
0043 Default is *5* percent.
0044 
0045 [*-s*] 'HALVE_START_PERCENT'::
0046 This is number of percents taken from the total pool of process running snapshots,
0047 to be marked as start of the first halve. For example if process have run for
0048 180 seconds, '-p' = 1 then we have 180 snapshots of data.  If '-s' is set to *40*,
0049 then first halve is calculated from 72 sec.
0050 Default is *40*.
0051 
0052 [*-t*] 'HALVE_STOP_PERCENT'::
0053 This is ending percentage of the snapshots used for average halving. For example
0054 if runtime was 180 sec, start ('-s') was *40* and stop ('-t') is *90*, then 
0055 we get following setup: average counting from 72 sec till 162 sec. Total 90
0056 snapshots, first halve 72..117 and ending 118..162.
0057 
0058 [*-n*] 'NEGATIVE_REGEX_MASK'::
0059 If set, then when *xmemck* is selecting the processes for monitoring the given
0060 'ps -ef' line must not match the '-n' parameter. If matches, then process is not
0061 monitored.
0062 
0063 [*-v*] 'MIN_VALUES'::
0064 Minimum number of values to use in one halve. If the number of snapshots is less
0065 than this number for the halve, then memory leak detection is not performed on
0066 this process.
0067 
0068 *-m* 'REGEX_MASK'::
0069 Regex mask used for process selection from 'ps -ef' output. If line matches the
0070 given expression, then PID is extracted and binary is monitored at '-p' interval
0071 for VSZ and RSS.
0072 
0073 
0074 EXAMPLE RUN
0075 -----------
0076 Sample run of the binary:
0077 
0078 --------------------------------------------------------------------------------
0079 
0080 $ xmemck -v20 -d30 -s60 -t95 -n 'atmiunit1|tpbridge|tmsrv' -m atmi -d70 -m tpbridge -m tmsrv 2>./memck.log 1>./memck.out &
0081 
0082 --------------------------------------------------------------------------------
0083 
0084 The given example monitors following:
0085 
0086 - (-v20) Min values 20
0087 
0088 - (-d30) Allow delta 30%
0089 
0090 - (-s60) Start at 60% of the runtime snapshots
0091 
0092 - (-t95) Stop calculating averages of the 95% of snapshots
0093 
0094 - (-n 'atmiunit1|tpbridge|tmsrv') Do not match 'atmiunit1', 'tpbridge' or 'tmsrv'
0095 
0096 - (-m atmi) Match "atmi"
0097 
0098 - (-d90) Change delta to 70 for next match
0099 
0100 - (-m tpbridge) Monitor process named *tpbridge*
0101 
0102 - (-m tmsrv) Monitor process named *tmsrv*
0103 
0104 When leak is detected, the following infos is printed to stdout:
0105 
0106 --------------------------------------------------------------------------------
0107 
0108 >>> 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]
0109 
0110 --------------------------------------------------------------------------------
0111 
0112 
0113 EXIT STATUS
0114 -----------
0115 *0*::
0116 Success
0117 
0118 *1*::
0119 Failure
0120 
0121 BUGS
0122 ----
0123 Report bugs to support@mavimax.com.
0124 
0125 SEE ALSO
0126 --------
0127 *xadmin(8)*
0128 
0129 COPYING
0130 -------
0131 (C) Mavimax, Ltd.
0132