Ok, this is interesting - it seems like do_gc (Pike 7.2) is called about once a every 70-90 seconds on this box. That's VERY often and very bad since it takes quite a long time (1.5 GB worth of data to iterate through).
I had previously disabled gc manually and will do so again, but does anyone have any idea why it's called so often (I added breakpoint to both do_gc and f_gc and only do_gc was called so it's not done manually).
/ David Hedbor
Previous text:
2002-12-09 20:49: Subject: Memory leak, how to find it?
Ok, so I have a Caudium server running either Pike 7.0 or 7.2. It's a search engine using an in-memory mapping based data structure for the search. Problem is, it's leaking memory. The 7.0 is leaking a lot faster than 7.2 it seems (have only tried running 7.2 a short period of time).
It never stabilizes which indicates that's it's not just ordinary increase due to fragmentation, caching etc. Using the only available tool, Debug info for developers, I do clearly see especially mappings but also strings increase in size. This MIGHT be a mapping-based cache that's caching more than it should but it's close to impossible to find out.
A snapshot of the debug info is available at http://david.hedbor.org/tmp/debug.gif One interesting thing to note is that there are -12862 - i.e there's obviously a bug in the object counting.
Since the number of mappings doesn't change as much, and sometimes decreases even though memory increases, it seems like it IS something that is being added to rather than a pure leak.. As a matter of fact, since the GIF snapshot, there are only 8 more mappings but almost 30 MB more memory used by them.
Does anyone have any good suggestions on how to figure this out? An optimal solution would be to be able to get a list of all mappings and their memory usage (or at least the ones using significant amount of memory, since there are 6.3 million mappings...).
/ David Hedbor