Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Feb 2008 07:58:49 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Arun Balakrishnan <arun.balakrishnan@wipro.com>
Cc:        kan@freebsd.org, freebsd-stable@freebsd.org
Subject:   Re: Memory Leak under FreeBSD 6.0 RELEASE
Message-ID:  <20080226055849.GN57756@deviant.kiev.zoral.com.ua>
In-Reply-To: <47C3982E.8000209@wipro.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080226055849.GN57756>