I was wondering if there was a way to use top or another program to track the memory consumption of a script I will be running. I was using
runtime.totalMemory - runtime.freeMemory
But that's not cutting it, as it takes into consideration the whole system, not just the process I want to track.
I'm using a shell script to run a scala program which I want to have its memory usage tracked.
/proc
filesystem and the pid of the child process, you could dig around thereunder for the per-process memory details. – thrig Jun 16 '16 at 17:45