[Patch] Memory allocation fixes (was: Re: konqy preloading kills performance)

Germain Garand germain at ebooksfrance.org
Wed Dec 15 08:51:29 GMT 2004


Hi!

Here attached are some fixes to the Arena allocator (which is responsible of 
managing memory for most of the Rendering engine) which could help /wrt the 
issues mentioned in this thread.

It mostly:
1) avoids leaking the global Arena freelist in case the last khtml part gets 
unloaded.
2) enforces the FREELIST_MAX limit. It currently is not and would happily use 
as many gigabytes as you'd throw it, without ever freeing them.
3) introduces a change of memory allocation strategy for heavy pages: over a 
given threshold, increase the pool sizes so that malloc gets a chance to give 
some ressources back to the OS (mostly via munmapping, though trimming is 
also more likely to happen with large chunks).

Here, this would give back about 35% of freed memory to the system after a 
heavy document gets unloaded.
What do you think?

Greetings,
Germain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: malloc.diff
Type: text/x-diff
Size: 5060 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041215/56a9e346/attachment.diff>


More information about the kfm-devel mailing list