We never call MarkPagesInUse on the nursery

NEW
Unassigned

Status

()

Core
JavaScript: GC
P3
normal
2 years ago
2 months ago

People

(Reporter: billm, Unassigned)

Tracking

({triage-deferred})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
I was doing some analysis of Windows memory usage today. On Windows, we use MEM_RESET to decommit unused pages. This flag allows the OS to reuse pages for other processes, but it still looks like the page is committed by Firefox. I wanted to find the true committed memory, so I changed MarkPagesUnused to use VirtualFree(MEM_DECOMMIT) and changed MarkPagesInUse to VirtualAlloc(MEM_COMMIT). With this change, Firefox immediately crashes because we never use MarkPagesInUse on the nursery.

This isn't really a problem since MarkPagesInUse is a no-op on all systems. However, it might be nice to use MEM_DECOMMIT/MEM_COMMIT in DEBUG builds or something. There's a danger that we could be touching pages that we've decommitted (causing the memory to be charged to Firefox) while our memory reporters still show it as decommitted.
Keywords: triage-deferred
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.