Open Bug 942892 Opened 11 years ago Updated 2 years ago

Warn users when their Firefox appears low on VM before crashing

Categories

(Firefox :: General, defect)

x86_64
Windows 7
defect

Tracking

()

People

(Reporter: benjamin, Unassigned)

References

Details

(Whiteboard: [MemShrink:P2])

Users who are running out of VM space will see their contiguous VM size go down as they approach OOM. We should warn users before they hit actual OOM, so that they can save work and restart Firefox.

This is Windows-only for now, since that's where we have the data. nsIMemoryReporter.vsizeMaxContiguous is the datapoint we need to monitor. It was added in bug 939385.
Whiteboard: [MemShrink]
Do we need to preallocate memory for this warning? Otherwise this warning could push us to OOM :)
Is there data to help us pick a good threshold? (eg once vsizeMaxContiguous reaches some X, how likely is it a crash will occur?) Seems like we wouldn't want this too low (false alarms), nor too high (too late to do anything).

Do we know anything about the rate at which vsizeMaxContiguous tends to change as it approaches exhaustion? Is it a slow decrease over a long time, or does it happen rapidly? Both?
Whiteboard: [MemShrink] → [MemShrink:P2]
We don't need to preallocate memory. Simple dialog boxes don't cost much memory in general.

What we're mainly worried about is small/normal heap allocations failing data shows that normal small allocation start failing when there is 1-10MB of vsize-max-contiguous left. Since that is a very small fraction of the minimum 2G address space, I'd propose a cutoff of 25MB vsize-max-contiguous, which is about 1% address space remaining, and should be enough for jemalloc to keep working for a bit. We're unlikely to be able to recover after that point anyway.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.