Open Bug 1916803 Opened 1 year ago Updated 1 year ago

Investigate using a background thread to decommit memory

Categories

(Core :: Memory Allocator, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: nical, Unassigned)

References

Details

This would be a performance improvement. Upstream jemalloc has this feature.

Instead of running madvise directly in the thread where free is called, mark the page as "pending decommit" and let a background thread run madvise or VirtualAlloc.

It sounds simple on paper but I'm sure that getting the synchronization right for marking pages as pending/decommitted and dealing with whatever code needs to run after the last page of a chunk has been madvised is fraught with peril.
That said, there is prior art for it and I see madvise a lot in profiles (at least on linux), so getting them off the critical path would be valuable, assuming similar overhead is observed on Windows.

See Also: → 1488780
You need to log in before you can comment on or make changes to this bug.