debugging mbuf allocation/dealocation

Nikola Knežević laladelausanne at gmail.com
Mon Dec 29 02:13:59 PST 2008


>
> You can use the KTR(4) facility to trace memory allocations and  
> deallocations, logging them to memory, disk, etc.  Unfortunately  
> interpreting the data can be fairly tricky, as network leaks tend to  
> happen over a long period of time, be stored in sockets, etc, but  
> it's definitely possible and has been done. :-) Processing the  
> results with a perl script goes a long way, as the allocated/freed  
> pointers are included, etc.

Hi Robert,

thanks for the pointers :)
I discovered that root cause of the leakage - Click::Packet had a bad  
destructor, which wasn't free-ing mbufs all the time. Since there are  
some other forms of leaking in Click, I'll use KTR do discover them.

Cheers,
Nikola


More information about the freebsd-hackers mailing list