Maintenance #699

Improve multi-process memory management

Added by Alfons Laarman over 7 years ago. Updated over 6 years ago.

Status:NewStart date:04 Mar 2013
Priority:NormalDue date:
Assignee:Alfons Laarman% Done:


Category:toolsSpent time:-
Target version:ltsmin-2.1


The current allocator in the multi-process environment (--procs=P) is a hack. It claims a large piece of anonymous pages using mmap at pre-fork time. Memory allocations are handled by giving out pointers continuously from this region (HREdefaultRegion(HREglobal()) is automatically set in the process environment).
For lack of administration freeing or reallocating memory is not possible.

To limit fragmentation two sets of functions were designed:
RTmalloc(...) - for local (non-scaling) allocation by the OS
HREmalloc(region, ...) - allocating from a designate region (Warning: it may fall back on RTmalloc)

RTswitchAlloc (true/false) is used to switch the behavior of RTmalloc to HREmalloc(HREdefaultRegion(HREglobal()), ...) transparently. This enables the use of allocator oblivious data structures.

1 - integrate a true allocator that works with inter-process memory.
a viable option seems the simple SSmalloc, it needs to be adapted to used the preallocated region though
2 - consolidate HREmalloc and RTmalloc (See #698)
with good allocator, HREmalloc with default region can be used as default


#1 Updated by Alfons Laarman over 6 years ago


Traces left of grey:

GB* functions in pins.[ch]

Also rename functions such as Warning to e.g. Report. Warning can print all types of messages: info, error, debug, etc.
Create naming scheme for similar functions, c.f.: Warning, Debug, DEBUG, Abort, etc

Add multiple info levels -v and -vv and -vvv (the last one should also provide localized tourist information)

consolidate HRE* and RT* ?

Also available in: Atom PDF