The memmon executable monitors a linux process and provides summary statistics about the memory usage of the process after it terminates.


Usage: memmon [options] /full/path/executable args ...
Report memory usage information for process, in particular the maximum
memory used.  The command line must be the full path to the executable.

  -t, --time=LIMIT              set poll time (in milliseconds) (default=1ms)
  -l, --limit=SIZE              set hard limit of SIZE Kb for memory
                                  consumption (default is none)
  -k, --kb=SIZE                 send signal 24 (SIGXCPU) if memory usage is
                                  greater than SIZE kilobytes
  -m, --mb=SIZE                 send 24 if memory usage > size megabytes
  -g, --gb=SIZE                 send 24 if memory usage > size gigabytes
  -s, --signal=SIG              send this signal instead of 24
  -o, --logfile=FILENAME        send output to logfile
  -i, --interval=TIME           milliseconds between periodic status printouts
  -v, --verbose                 more output
  -q, --quiet                   less output (default)


The memmon command provides a utility for monitoring the memory usage of a process. In particular, memmon provides a convenient mechanism to report the maximum amount of memory that a process uses.


The memmon command requires the absolute path to the command that will be executed. Beyond that, its default syntax is quite simple:

$ ./memmon /bin/sleep 1
53768 Kb used

The memmon command can also be used to terminate a process whose memory exceeds a specified threshold:

$ ./memmon -k 10 /bin/sleep 1
./memmon: Error: memory exceeded
53764 Kb used