Mem leak : malloc/free + pthreads = leakage?
Eygene Ryabinkin
rea at freebsd.org
Sat Mar 5 12:23:04 UTC 2011
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).
>
> Does anyone know of issues regarding malloc/free on multithreaded
> userland apps?
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.
--
Eygene Ryabinkin ,,,^..^,,,
[ Life's unfair - but root password helps! | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110305/7950b1fa/attachment.pgp
More information about the freebsd-hackers
mailing list