Is there a tool that will run a command-line and report how much RAM was used total?
I'm imagining something analogous to /usr/bin/time
Is there a tool that will run a command-line and report how much RAM was used total?
I'm imagining something analogous to /usr/bin/time
You can use a tool like Valgrind to do this.
Sorry, I am first time here and can only ask questions ...
Used suggested:
valgrind --tool=massif --pages-as-heap=yes --massif-out-file=massif.out ./test.sh; grep mem_heap_B massif.out | sed -e 's/mem_heap_B=(.*)/\1/' | sort -g | tail -n 1
then grep mem_heap_B massif.out ... mem_heap_B=1150976 mem_heap_B=1150976 ...
this is very different from what "top" command shows at similar moment :
14673 gu27mox 20 0 3280404 468380 19176 R 100.0 2.9 6:08.84 pwanew_3pic_com
what are measured units from valgrind ??
The
/usr/bin/time -v ./test.sh
never answered - you must directly feed executable to /usr/bin/time like:
/usr/bin/time -v pwanew_3pic_compass_2008florian3_dfunc.static card_0.100-0.141_31212_resubmit1.dat_1.140_1.180 1.140 1.180 31212
/usr/bin/time maybe does what you want, actually. Something like.
See time(1) for details...
On Linux:
Use
/usr/bin/time -v <program> <args>
and look for "Maximum resident set size".(Not to be confused with the Bash
time
built-in command! So use the full path,/usr/bin/time
)For example:
On BSD, MacOS:
Use
/usr/bin/time -l <program> <args>
, looking for "maximum resident set size":Use Massif: http://valgrind.org/docs/manual/ms-manual.html
On MacOS Sierra use:
You can use
grep
to take what you want maybe.