From owner-freebsd-current@FreeBSD.ORG Wed Jul 27 17:52:01 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8062E16A41F for ; Wed, 27 Jul 2005 17:52:01 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.136]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBCBD43D46 for ; Wed, 27 Jul 2005 17:52:00 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id C2BECACC59; Wed, 27 Jul 2005 19:51:58 +0200 (CEST) Date: Wed, 27 Jul 2005 19:51:58 +0200 From: Pawel Jakub Dawidek To: freebsd-current@freebsd.org Message-ID: <20050727175158.GP46538@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aWJO9/nTw6Gaxdug" Content-Disposition: inline User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: malloc(9) statistics. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 17:52:01 -0000 --aWJO9/nTw6Gaxdug Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. I spend few hours today tracking memory leak. At the end I found, that there were no memory leak actually, but memory statistics are confusing. Command 'vmstat -m' shows number of allocations in column named "InUse". Coulmn name is wrong and confusing. The column only shows how many allocation were there (successful or not), so when malloc(..., M_NOWAIT) fails, it increases InUse value, which is never decreased, because there will be no corresponding free(9). I've two proposals: 1. Don't increase allocations counter on failure: http://people.freebsd.org/~pjd/patches/kern_malloc.c.patch 2. Change "InUse" name to something else. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --aWJO9/nTw6Gaxdug Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFC58m+ForvXbEpPzQRAt78AKDuVGRT/vpzb4CVitiou0cIqYRICwCeNopl pHVJR9Pt3dR4crHvK2cGbtU= =c4kW -----END PGP SIGNATURE----- --aWJO9/nTw6Gaxdug--