Summary: | to reduce memory: generalise 'reclaimSuperBlock' to also reclaim splittable superblock | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Philippe Waroquiers <philippe.waroquiers> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | philippe.waroquiers |
Priority: | NOR | ||
Version: | 3.7 SVN | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
generalised reclaimSuperBlock + activate unsplittable reclaim for all Arena
generalised reclaimSuperBlock + activate unsplittable reclaim for all Arena generalised+deferred reclaimSuperBlock + activate unsplittable reclaim for all Arena |
Description
Philippe Waroquiers
2011-09-15 21:20:31 UTC
Created attachment 63733 [details]
generalised reclaimSuperBlock + activate unsplittable reclaim for all Arena
Slightly improved version:
* small improvement of m_mallocfree.c performance
(about 10% on perf/heap)
* added statistics about reclaim in profile-heap
* a few comment changes
* fixed exp-sgcheck hsg.c test.
I did a few more trials (with the new stats) regarding the need of a deferred reclaim. There is at least one regression test which behaves very badly without the deferred reclaim (drd/tests/memory_allocation.c). The deferred reclaim with the following logic will solve this kind of bad behaviour, and will reclaim all blocks when needed: * reclaim immediately "big unsplittable blocks". * defer the reclaim of splittable block till either: another block is 'deferred reclaimed' in the same arena or a new superblock is needed in any other arena. With this, it will both avoid pathological behaviour like in memory_allocation.c, avoid fragmentation and ensure the same 'max peak mmap memory'. I will work on that approach this evening, and submit a new patch version. Created attachment 63783 [details]
generalised+deferred reclaimSuperBlock + activate unsplittable reclaim for all Arena
Implements deferred reclaim : splittable blocks are not reclaimed directly.
Instead, they are reclaimed when either another block can be (deferred) reclaimed
in the same arena or when a new superblock is needed in this or any other arena.
This limits memory usage and fragmentation, and keeps good performance
even for malloc/free sequences "around' superblock limits.
Tested on amd64 debian5 + x86 f12 + launched a firefox with it.
Committed, r12047. Thanks! |