Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Mar 2011 15:23:00 +0300
From:      Eygene Ryabinkin <rea@freebsd.org>
To:        Eric Anderson <anderson@ttel.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Mem leak : malloc/free + pthreads = leakage?
Message-ID:  <g%2B9/OWFOOUBNE3KhEpL7PKrnUCc@QsmfhJNucgI88DfvPJdT1/nyboE>
In-Reply-To: <40A52D4A-9397-4406-A7EC-E7CBBEFADD55@freebsd.org>
References:  <40A52D4A-9397-4406-A7EC-E7CBBEFADD55@freebsd.org>

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

--TXIPBuAs4GDcsx9K
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Fri, Mar 04, 2011 at 10:02:45PM -0600, Eric Anderson wrote:
> I have a moderately threaded userland program (all C) I am working
> on (using pthreads, freebsd 8.1 64bit).  It seems to leak memory
> (using standard malloc/free) badly.  I am using pcap to capture
> packets and process them. I have a handful of libs statically linked
> in (pcap is one, the rest don't seem to matter - I can remove them
> and still see the leak). =20
>=20
> Does anyone know of issues regarding malloc/free on multithreaded
> userland apps? =20

I personally hadn't heard about them, but you can definitely run
your program under Valgrind's memcheck tool -- it often does the
good amount of work and detects many leaks.  Valrgind is ported
to FreeBSD, devel/valgrind.
--=20
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]

--TXIPBuAs4GDcsx9K
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iF4EAREIAAYFAk1yKyQACgkQFq+eroFS7Ps/IAD/S06+1lvXvjsNfSKWu/tn7lBr
RMWyq0DqloGZzMoEew8A/j+oniP5m/tcyTLpYaHfm5oCT0VzugcHkgJ9SMw2oz5Q
=kDT7
-----END PGP SIGNATURE-----

--TXIPBuAs4GDcsx9K--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?g%2B9/OWFOOUBNE3KhEpL7PKrnUCc>