Aqui estão dois métodos para rastrear o pico de uso de memória de um processo.
Xaroposo
Eu não usei essa ferramenta, mas parece que você está procurando. Chama-se Xaroposo .
Descrição
Syrupy is a Python script that regularly takes snapshots of the memory and CPU load of one or more running processes, so as to dynamically build up a profile of their usage of system resources.
Exemplo
$ syrupy.py myprog
PID DATE TIME ELAPSED CPU MEM RSS VSIZE
14634 2008-10-10 20:45:25 00:00 0.0 0.0 2996 6680
14634 2008-10-10 20:45:26 00:01 105 0.2 7804 12592
14634 2008-10-10 20:45:27 00:02 103 0.2 8996 13776
14634 2008-10-10 20:45:28 00:03 103 0.2 10468 15348
14634 2008-10-10 20:45:29 00:04 103 0.3 11412 16396
14634 2008-10-10 20:45:30 00:05 104 0.3 12492 17444
/usr/bin/time -v
Sim, ironicamente, o comando de tempo do GNU pode fornecer o pico de uso de memória de um processo. Ele relata a memória de pico da seguinte forma: Maximum resident set size (kbytes)
.
Exemplo
$ /usr/bin/time -v ~/projects/prime_numbers/eratosthenes_prime_sieve.pl 10 1000000
...
Command being timed: "/home/saml/projects/prime_numbers/eratosthenes_prime_sieve.pl 10 1000000"
User time (seconds): 1.12
System time (seconds): 0.05
Percent of CPU this job got: 54%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.19
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 79304
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 20014
Voluntary context switches: 83
Involuntary context switches: 274
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0