Closed Bug 989367 Opened 12 years ago Closed 12 years ago

Investigate B2G heap fragmentation

Categories

(Core :: JavaScript: GC, defect)

24 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 989379

People

(Reporter: mccr8, Unassigned)

Details

(Whiteboard: [MemShrink])

In bug 981871, Nathan noticed that unused-gc-things increases by half a meg over the course of 9 hours (after already having run for 9 hours), which seems like quite a bit. We should investigate what is happening there. I wrote a script to parse in a GC log, in terms of how many objects are in each arena, which should be usable to analyze fragmentation. Maybe we can figure out why there seems to be so much. It should be said that in the bug in question involved slowly growing memory, which makes fragmentation worse, but it still seems like the fragmentation shouldn't keep growing.
Here's the number of arenas with various percentages unused memory (which includes slop). As you can see, if my calculations are right, there are a huge number of mostly empty arenas. I wonder if our memory is really peaking so high, or if we're somehow not allocating out of existing arenas very well: 95%: 211, 90%: 68, 85%: 30, 80%: 28, 75%: 25, 70%: 25, 65%: 25, 60%: 31, 55%: 28, 50%: 38, 45%: 15, 40%: 20, 35%: 25, 30%: 23, 25%: 35, 20%: 31, 15%: 33, 10%: 36, 5%: 68, 0%: 420, This script is https://github.com/amccreight/heapgraph/blob/master/g/arena_parser.py
I just filed bug 989379, which is very much along the same lines as this one. Terrence and jonco were just talking about how we allocate new GC things out of arenas -- it might miss opportunities to re-use empty slots.
Mine is basically the same as yours, so I'll just dupe it. Though I will point out mine was filed first. ;)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
> Though I will point out mine was filed first. ;) Mine is more general :P
You need to log in before you can comment on or make changes to this bug.