Self-collecting Mutators are Self-compacting

An analysis about memory consumption in real-periodic systems

An average program often allocates temporary memory, so called short-term memory, which is discarded as the program proceeds. If we plot the amount of memory allocated on the heap against the execution time of the program, we will observe that it is growing and shrinking continuously in periods. The time axis must therefore not represent the processor or environmental time, but logical points in the program where memory is deallocated. Even complex programs show this periodic behavior, for example if they are abstracted with multiple clocks.

To find an allocator that has good behavior in memory consumption (which would be if the gross memory slightly differs from the net memory), I propose to have a closer look on the memory periods that exist in most programs. With the knowledge of knowing which objects are short-living and which are long-living, even a simple sequential fit allocator might give optimal results.

The goal of the Self-Collecting Mutators are Self-Compacting project is to provide a memory management system that allows to analyze the periodic memory consumption, and as a consequence also the fragmentation, of programs using a time-aware memory model: The short-term memory model. The two implementations - short-term memory with compact-fit and short-term memory with regions - use alternative allocators in despite of the original implementation with ptmalloc2. I decided to use compact-fit as an allocator which is able to bind memory fragmentation by performing compaction if the fragmentation exceeds the limit. The implementation attempts to provide information about how many compactions are necessary for different periods. For a multi-clock implementation, I used a region-based memory allocator. A clock is then bound to a region. The region-based implementation aims to prevent massive fragmentation, as memory with similar life-time is allocated into the same region.

Documentation

Presentation

Project Report

Implementation

Short-term memory with compact-fit (Note: works only on 32bit systems)

Short-term memory with regions