MPS issue job003799

TitleIncrementally collecting the nursery may waste time
Statusopen
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIn typical customer use, we observe that it's possible for the MPS to collect the entire nursery generation without impacting interactive performance (pause time under a centisecond). In this situation, we waste time incrementally collecting the nursery (because we incur a per-segment overhead that we don't benefit from).
AnalysisAt the moment AMC always hands out the smallest buffer it can that will satisfy the request. This is due to a combination of three constraints:

1. The MPS does not know the client program's pause time requirements, so in order to satisfy these unknown requirements it always returns as quickly as it can. See job003539.
2. An ambiguous reference pins down the whole segment (and wastes the reclaimed space) and bigger buffers are more likely to be pinned, so it is best to keep the buffers as small as possible. See job003797.
3. The MPS does not measure its collection performance so it does not know how big a buffer it can afford to hand out before it can't collect it in the time available.

Plan of action: fix job003539 and job003797 first. Then measure collection performance and use it to feed back into the AMC buffer size calculation.

DL points out some caveats:

1. Scanning performance is likely to vary and so we risk missing our target. (We could start conservatively and measure the worst case? Or the client could set their preferred pause time to zero and then the MPS would revert to its current behaviour.)
2. In the general case there are multiple allocation points pointing into the same nursery generation. It is not at all obvious how to apportion the nursery size among these allocation points. (Measure the rate of allocation on each point and give each one a buffer proportional to its rate?)
3. A perfect computation of how much we can hand out is complicated: depends on collection rate, the cost of a barrier hit, and the operating system overhead (which varies by operating system).

A very simple experiment to try, to see if there's actual potential for gain here, is to change AMC so that it creates larger buffers.
How foundmanual_test
EvidenceMPS strategy discussion <https://info.ravenbrook.com/mail/2014/05/15/19-19-13/0/>
Created byGareth Rees
Created on2014-05-15 20:12:23
Last modified byGareth Rees
Last modified on2014-05-20 22:31:09
History2014-05-15 GDR Created.