From owner-freebsd-questions@FreeBSD.ORG Fri Sep 5 07:40:35 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80DEE16A4BF for ; Fri, 5 Sep 2003 07:40:35 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7465144014 for ; Fri, 5 Sep 2003 07:40:33 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h85EdqQr079903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Sep 2003 15:40:28 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h85EdqdX079902; Fri, 5 Sep 2003 15:39:52 +0100 (BST) (envelope-from matthew) Date: Fri, 5 Sep 2003 15:39:52 +0100 From: Matthew Seaman To: Jesse Guardiani Message-ID: <20030905143952.GA79611@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Jesse Guardiani , freebsd-questions@freebsd.org References: <20030904124052.GD88888@happy-idiot-talk.infracaninophile.co.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-11.5 required=5.0 tests=AWL,BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: process memory peak recording X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2003 14:40:35 -0000 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 05, 2003 at 10:03:31AM -0400, Jesse Guardiani wrote: =20 > 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... :) =20 > 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. >=20 > 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 --=20 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 --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/WKA4dtESqEQa7a0RArZIAJ9dc+KNkuL6TAnJYUc+t91olM4xMwCeK40P vkIm4fpB3MFJ5e1JYT0DgyY= =2sm2 -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi--