Skip to content
Snippets Groups Projects
Commit 33dfb61f authored by Matthew Pickering's avatar Matthew Pickering
Browse files

rts: Make allocatePinned always take a new block

This change surprisingly fixes quite bad fragmentation issues

When a new block was stolen from the nursery it meant that on the next
GC that the nursery had to be resized and the stolen block replaced.
This led to a few (1 or 2) random blocks from the free list being added to
the nursery, from which they would never escape. Over time, the rest of
the blocks in these megablocks would get collected but the nursery would hold onto 1
block from many different megablocks. This led to the situation where
there were many nearly empty megablocks in the free list.
parent 29d4df0f
Branches ghc-idle-gc-backport
No related tags found
No related merge requests found
......@@ -1125,7 +1125,7 @@ allocatePinned (Capability *cap, W_ n)
// So first, we try taking the next block from the nursery, in
// the same way as allocate().
bd = cap->r.rCurrentNursery->link;
if (bd == NULL) {
if (bd == NULL || true) {
// The nursery is empty: allocate a fresh block (we can't fail
// here).
ACQUIRE_SM_LOCK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment