Title | Memory returned to operating system too eagerly |
Status | closed |
Priority | essential |
Assigned user | Richard Brooksby |
Organization | Ravenbrook |
Description | Profiling the MPS (see job003371 and job003674) shows that the MPS is spending a significant fraction of its runtime in mmap and munmap. |
Analysis | The MPS has a hysteresis mechanism (the "spare committed memory") but it was being purged at the end of each collection. When collections were rare, this didn't matter all that much, but these days we are seeing garbage collection frequencies of tens of times a second and the overhead is now significant. Returning memory to the operating system over-eagerly has the following bad consequences: 1. the system call overhead; 2. it thrashes the operating system's backing store allocator; 3. it modifies the operating systems' page table unnecessarily, and so thrashes the TLB; 4. mapping memory requires the operating system to zero it (for security reasons) which would be unnecessary if the memory was retained and re-used. |
How found | manual_test |
Evidence | See description. |
Created by | Gareth Rees |
Created on | 2014-03-17 13:48:54 |
Last modified by | Gareth Rees |
Last modified on | 2014-03-17 13:49:12 |
History | 2014-03-17 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
184359 | closed | 2014-02-17 17:05:37 | Richard Brooksby | Merging spare-ring branch into master, from //info.ravenbrook.com/project/mps/branch/2014-01-25/spare-ring/... |