|Title||MPS does not try collecting when out of memory|
|Assigned user||Gareth Rees|
|Description||MMQA test function/130.c  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 .
|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.