Decay behaviour of -Fd flag may lead to thrashing
@simonmar writes about -Fd that:
The post is correct to say that we need 2L memory to do copying collection when there is L live bytes. But it seems to ignore the fact that we don't collect until the heap has grown to F*L bytes (where F=2 by default), which means that in a steady state of L live bytes we actually need (1+F)L bytes (plus the nursery). This is where the original default of returning memory above (2+F)L came from: we know we need (1+F)L, plus a bit for the nursery, plus we add on another L so that we don't thrash.
If I'm understanding the way -Fd works, it will return memory until we're below the 3L value, which will definitely lead to thrashing because we'll reallocate the memory to get back to 3L at the next major GC, assuming L remains constant.
I think you would want to decay from (2+F)L to (1+F)L, but no lower than that. Also, saying that we're "scaling F" is not really the right way to think about it, since F is not actually changing, it's the fudge factor we want to change.