process memory peak recording

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri Sep 5 07:40:35 PDT 2003


On Fri, Sep 05, 2003 at 10:03:31AM -0400, Jesse Guardiani wrote:
 
> Sorry for the misleading subject. I meant to post a different message
> under that subject. "process memory peak recording" should have been the
> subject for this message. I'm not sure if that was a bug in my human CPU
> or a bug in KNode... :)
 
> Anyway, I was really hoping that someone would write me back and tell me
> that there is already some voodoo kernel debugging switch that I could
> turn on to let me log/record peak memory usage for a particular process.
> 
> I guess you're saying that isn't the case though, right?

As far as I know, that is the case: there is no way to retrospectively
find the peak memory usage of a process.  Of course, the kernel can
tell you what the memory usage of a process is right now, but that
information isn't systematically recorded anywhere, to the best of my
knowledge.

The closest thing I can find to doing that is the 'sa -K' command,
which gives you the "CPU storage integral, in 1k-core seconds" -- as
well as not being the statistic you want, that also lumps together the
data for all instances of a particular command.

Another approach that occurred to me might be feasible would be to use
the limits(1) facility to set a maximum virtual memory size for the
process.  Then do a binary search to find the smallest virtualmem
limit that would still permit the process to complete.  But that
really only works if you can run the same process with the same
arguments over and over again and always get the same result each
time.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030905/6976b2fa/attachment.bin


More information about the freebsd-questions mailing list