mbuf leaks

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Fri Aug 19 08:57:57 AEST 1988


In article <2881 at ttidca.TTI.COM> mb at ttidca.tti.com (Michael Bloom) writes:
: Can anyone suggest good techniques for tracking down mbuf leaks?

I don't know if this is still valid, but in 4.2 I split up the DATA mbuf
type into twenty-some-odd different types of mbufs, depending on where they
were allocated.  After tweaking netstat to show which DATA type, it was easy
to see which allocator didn't have a matching deallocator.  Generally
that was sufficient to deduce the location of the leak.  Sometimes a
judicious printf or two helps as well, just so you don't go overboard.
Generally you want to hide a printf behind a debugging variable you can
turn on and off with adb.

There may be better tools to diagnose this by now...

Larry Wall
lwall at jpl-devvax.jpl.nasa.gov



More information about the Comp.unix.wizards mailing list