From owner-freebsd-stable@FreeBSD.ORG Tue Feb 26 05:59:06 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EDF116A481; Tue, 26 Feb 2008 05:59:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by mx1.freebsd.org (Postfix) with ESMTP id D477D13C45A; Tue, 26 Feb 2008 05:59:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay01.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JTsq7-00006p-OU; Tue, 26 Feb 2008 07:59:04 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id m1Q5wT22086646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Feb 2008 07:58:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m1Q5wpgX023073; Tue, 26 Feb 2008 07:58:51 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m1Q5wobh023072; Tue, 26 Feb 2008 07:58:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 26 Feb 2008 07:58:49 +0200 From: Kostik Belousov To: Arun Balakrishnan Message-ID: <20080226055849.GN57756@deviant.kiev.zoral.com.ua> References: <47C00A1B.5030708@wipro.com> <20080223214313.GF57756@deviant.kiev.zoral.com.ua> <47C2511D.5040202@wipro.com> <20080225140757.GL57756@deviant.kiev.zoral.com.ua> <47C3982E.8000209@wipro.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2ocJUWvX1oJrWFGM" Content-Disposition: inline In-Reply-To: <47C3982E.8000209@wipro.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 8f05f8c1fbcffa8edf4596457ca31d97 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2313 [Feb 25 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: kan@freebsd.org, freebsd-stable@freebsd.org Subject: Re: Memory Leak under FreeBSD 6.0 RELEASE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 05:59:06 -0000 --2ocJUWvX1oJrWFGM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2008 at 10:10:14AM +0530, Arun Balakrishnan wrote: > My previous mail was this: >=20 > --------------------------------------------------------------------- >=20 > Wow! Thanks a lot for the reply. The patch you provided really gave=20 > some insight on the underlying problem. >=20 > In our final product, the library will be loaded and used only once=20 > per instance. However the automated test suites for the library, do this= =20 > for over 2000 times as part of functional testing and memory leak=20 > testing. In this we were getting a huge leak on FreeBSD. >=20 > One more question though. (Second one in the list of queries I had=20 > posted in my first mail.) >=20 > 2. While executing this without Valgrind, in another terminal we did a > "ps -Aopid,rss | grep LibLoader_" continuously in a loop and saw that > the RSS (resident set size) field value keeps increasing by 4KB every > now and then. The same experiment on GNU/Linux shows that RSS remains > at the same value. What could be the cause for the ever rising RSS > value? >=20 > Could you throw some light on what could be the possible reason for=20 > this? Is RSS value directly mappable to the leak that we see in libc?=20 > This is another issue that is acting as a show stopper for us. I did not track closely recent malloc development and improvements in the FreeBSD. In any case, I think you have some misunderstanding of the VM concepts there. =46rom the very high level view, kernel uses physical memory to cache the virtual memory content. There, RSS approximately shows amount of the cache used by the process. Change of the RSS size over time may be caused by a lot of reasons, in particular, process working set changes over time, load on the system, kernel VM algorithms etc. The overall direction is that, on the system with negligible load except observed process and enough physical memory, the RSS would be approximately equial to the optimal process working set. The leak then would definitely increase an amount of physical memory allocated for the process. I would not put much attention to the RSS alone. Did you tested the patch ? What was the behaviour with the patch applied ? >=20 > --------------------------------------------------------------------- >=20 > Thanks again, > ~Arun >=20 > Kostik Belousov wrote: > >On Mon, Feb 25, 2008 at 10:54:45AM +0530, Arun Balakrishnan wrote: > > > >I am unable to reply to HTML mail. Please, repost it with plain text > >content. >=20 >=20 > The information contained in this electronic message and any attachments = to=20 > this message are intended for the exclusive use of the addressee(s) and m= ay=20 > contain proprietary, confidential or privileged information. If you are n= ot=20 > the intended recipient, you should not disseminate, distribute or copy th= is=20 > e-mail. Please notify the sender immediately and destroy all copies of th= is=20 > message and any attachments.=20 > WARNING: Computer viruses can be transmitted via email. The recipient=20 > should check this email and any attachments for the presence of viruses.= =20 > The company accepts no liability for any damage caused by any virus=20 > transmitted by this email. >=20 > www.wipro.com --2ocJUWvX1oJrWFGM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkfDqpkACgkQC3+MBN1Mb4hC3wCeLPy/1Vy8AHuXjaOURMb21Ryp OJkAnR8k7WjP4kSgxQ9gQDojKoq6CuZL =nEVN -----END PGP SIGNATURE----- --2ocJUWvX1oJrWFGM--