Closed Bug 1506733 Opened 1 year ago Closed 1 year ago

Try to decommit unused part of nursery chunks

Categories

(Core :: JavaScript: GC, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

(Blocks 2 open bugs)

Details

(Keywords: memory-footprint, Whiteboard: [MemShrink:P1])

Attachments

(4 files)

After Bug 1433007 lands the nursery will be able to use fractions of a chunk.  This allows us to decommit the parts of a chunk that we're not using.
Whiteboard: [MemShrink] → [MemShrink:P1]
Priority: -- → P3
Priority: P3 → P2
Blocks: 1550382

Paul, is this still relevant? I know some work landed already about reducing the size of the nursery.

Flags: needinfo?(pbone)

Yep. it's all related.

I'll summarise but let me know if you need more info.

Bug 1433007 allows the nursery to use less than 1MB, but that memory is not released to the OS, it's just not actively used by JS or anything else.
This bug proposes to decommit that memory, releasing the physical RAM to the OS.
Bug 1499570 landed yesterday and decommits whole chunks as the nursery releases them. It's a separate case of where we can handle memory better, but related because it involved decommitting memory & the JS Nursery.

Flags: needinfo?(pbone)

This class will not just decommit whole chunks, so rename it to not imply
that as much.

This refactoring is required for the next change.

Depends on D35589

Depends on: 1561832
Blocks: 1562550
Attachment #9073339 - Attachment description: Bug 1506733 - (part 3) Decommit unused portion of Nursery chunks r=jonco → Bug 1506733 - (part 4) Decommit unused portion of Nursery chunks r=jonco
Pushed by pbone@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/78a0e74fae92
(part 1) Rename NurseryDecommitChunkTask r=jonco
https://hg.mozilla.org/integration/autoland/rev/2d990d87e35b
(part 2) Refactor how the NurseryDecomitter finishes r=jonco
https://hg.mozilla.org/integration/autoland/rev/f381dc55a8bc
(part 3) Re-initalise memory regions when growing the nursery r=jonco
https://hg.mozilla.org/integration/autoland/rev/fbfcb9fbf6c5
(part 4) Decommit unused portion of Nursery chunks r=jonco

Hi perfherders.

Hopefully this will drop minimum resident memory by 768K.

Thanks.

Flags: needinfo?(igoldan)

Paul, it looks like this showed an improvement on Linux but not other platforms. Is it possible the decommit logic isn't doing the right thing on other platforms, or are we only expecting this to work on Linux?

There does appear to be a difference in logic of SpiderMonkey's decommit and mozjemalloc's decommit (VirtualAlloc vs VirtualFree). This might be intentional or the term decommit might not even mean the same thing in these contexts.

Flags: needinfo?(pbone)
Depends on: 1564674

Thanks erahm,

I was expecting this to be cross platform because I assumed that code "just worked". I've filed Bug 1564674.

Flags: needinfo?(pbone)

(In reply to Eric Rahm [:erahm] from comment #11)

the term decommit might not even mean the same thing in these contexts

Indeed, we use the term decommit to mean something else here. This is arguably a bug itself.

Regressions: 1565272

(In reply to Paul Bone [:pbone] from comment #9)

Hi perfherders.

Hopefully this will drop minimum resident memory by 768K.

Thanks.

Thanks for the heads up!

Flags: needinfo?(igoldan)
You need to log in before you can comment on or make changes to this bug.