Cast not your Perl before swine?
bart.plug at whiteley.org
Mon Dec 17 15:53:42 MST 2007
On Dec 17, 2007 3:36 PM, Bryan Sant <bryan.sant at gmail.com> wrote:
> On Dec 17, 2007 3:01 PM, Dave Smith <dave at thesmithfam.org> wrote:
> > I like this: "ps -eo pid,comm,vsz"
> > It gives you each process ID, name, and the amount of virtual memory
> > it's using, in KBytes. Beware, though, because Linux can mislead about
> > how much memory is actually in use.
> I've found ps/top misleading too. I've always heard that you only
> look at the "RSS" (resident) column. The other columns double-count
> the size of all the shared libs that a process uses (which are loaded
> only once for all processes).
> Anyway, what I'm trying to do is see how much memory java allocs for a
> "Hello World" app. The app starts and terminates too quickly for me
> to catch it with ps or top. I was hoping there would be a command
> similar to "time" that I could run that would keep track of the memory
> used. I wonder if I could parse the output of strace or something and
> count up all the malllocs.
valgrind --tool=memcheck -v <program>
is a start. --tool=massif might also be interesting.
More information about the PLUG