To Leak or To fragment that is the question....

What I thought was a memory leak now looks to be a problem with memory fragmentation. Having now had a chance to run DVBStreamer for a day and half collecting memory stats using mtrace, it appears that no memory is being leaked.
Thats the good news, the bad news is that libdvbpsi is doing arround 6,000,000 mallocs and frees in that time (which may explain the ~900MB mtrace file I ended up with :-P ). Given the number of mallocs there is bound to be some fragmentation resulting in malloc needing to pull in more virtual memory from the system to supply libdvbpsi, this would explain the 2018MB being used by DVBStreamer.
I have a solution to the problem which should see libdvbpsi's allocation go from 6,000,000 > ~6 (depending on the size of some tables), just have to test it now (unfortunately this will require a patch to libdvbpsi).

Posted by Adam Charrett 2006-11-10

Log in to post a comment.