Ben Goodger Explains Higher Memory Usage in Firefox 1.5 (MozillaZine)
Posted Feb 16, 2006 21:19 UTC (Thu) by oak
In reply to: Ben Goodger Explains Higher Memory Usage in Firefox 1.5 (MozillaZine)
Parent article: Ben Goodger Explains Higher Memory Usage in Firefox 1.5 (MozillaZine)
This might be explained by Glibc allocator which is fast & good, but
tends not to free memory very easily.
If you get even a small allocation at the top of the heap (e.g. new tab),
freeing 400MB memory beneath that allocation doesn't return it back to
the system (or make it non-resident), it's just returned back to the
C-library. The small allocation could be something valid, or a leak,
it doesn't matter for the heap (heap/sbrk() works like a stack).
Glibc does >128KB sized allocations with mmap() i.e. not from heap, so
those don't suffer from this problem. They get returned back to the system
immediately when the application free()s them.
BSD allocator uses mmap() & madvise() for all allocations, but that means
using more memory when the memory usage is not so dynamic. Neither Linux
glibc nor BSD allocator is better, they are different.
to post comments)