Title | MPS does not try collecting when out of memory |
Status | open |
Priority | nice |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | MMQA test function/130.c [1] carries out the following steps: 1. Set the commit limit. 2. Allocate live objects until the commit limit is reached. 3. Destroy all roots (so that all objects are now dead). 4. Allocate more objects. It fails at step (4) with COMMIT_LIMIT. This despite the fact that all objects are dead, and so a garbage collection will be able to reclaim enough space to satisfy the request. |
Analysis | The sequence of calls that fail to allocate memory is mps_reserve → mps_ap_fill → BufferFill → AMCBufferFill → ChainAlloc → SegAlloc → ArenaAlloc → arenaAllocPolicy. Now, arenaAllocPolicy has five ways to try to get memory to satisfy the request, but collecting garbage is not one of them. Note that although in this case arenaAllocPolicy could try starting or progressing a collection, in general that's not possible, because ArenaAlloc can also be called by the collector (for example, to allocate a nailboard, or a forwarding buffer for copied objects) and the MPS must not recurse [2]. |
How found | automated_test |
Evidence | [1] http://www.ravenbrook.com/project/mps/master/test/function/130.c [2] http://www.ravenbrook.com/project/mps/...ml#design.mps.sp.sol.depth.no-recursion |
Test procedure | function/130.c |
Created by | Gareth Rees |
Created on | 2014-05-12 17:04:25 |
Last modified by | Gareth Rees |
Last modified on | 2014-10-24 12:45:30 |
History | 2014-05-12 GDR Created. 2014-10-24 GDR More analysis; downgraded to nice since it's not affecting anyone. |