Walt Mankowski on 17 Sep 2012 08:46:01 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Report the max memory used by a given command?

On Mon, Sep 17, 2012 at 08:34:37AM -0700, Paul Jungwirth wrote:
> Is there any way to run a command `foo` and see the maximum memory it
> allocated? I'm not talking about `top` and kin; I'm looking for
> something like `time foo` that runs `foo` and when it finishes prints
> how much memory it allocated. My attempts at googling just turn up
> system-wide tools like `top`.

I think "maxresident" might be what you're looking for.  If not, look
through the "Formatting the Output" section of time(1)'s manpage and
try out some of the other options.

Also, make sure you're running time(1) and not your shell's builtin
time function.  It sounds like you're running

$ time mycommand

Instead, try running

$ /usr/bin/time mycommand

It will return a lot more information.


Attachment: signature.asc
Description: Digital signature

Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug