Closed Bug 988053 Opened 11 years ago Closed 11 years ago

Commit nursery allocation as we go

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file, 4 obsolete files)

Attached patch start_memory_uncommitted-v0.diff (obsolete) (deleted) — Splinter Review
Should dramatically reduce the memory spike on M-oth.
Attachment #8396771 - Flags: review?(jcoppeard)
Comment on attachment 8396771 [details] [diff] [review] start_memory_uncommitted-v0.diff Review of attachment 8396771 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/Memory.cpp @@ +78,5 @@ > +void * > +gc::RetainAlignedAddressRange(JSRuntime *rt, size_t size, size_t alignment) > +{ > + int type = MEM_RESERVE; > + VirtualAllocAligned(rt, size, alignment, ); Seems like this won't compile - did you forget to qref? ::: js/src/gc/Memory.h @@ +20,5 @@ > InitMemorySubsystem(JSRuntime *rt); > > +// Add a mapping for an aligned address range, but do not commit the memory. > +void * > +RetainAlignedAddressRange(JSRuntime *rt, size_t size, size_t alignment); I'm not sure about the name "retain". To me this sounds like the address range was already present somehow. Maybe we could just go with AllocateAlignedAddressRange?
Attachment #8396771 - Flags: review?(jcoppeard)
Attached patch start_memory_uncommitted-v1.diff (obsolete) (deleted) — Splinter Review
No, even dumber: I copied after roughing out the idea and not after fixing the bugs in the linux impl.
Attachment #8396771 - Attachment is obsolete: true
Attachment #8397062 - Flags: review?(jcoppeard)
Comment on attachment 8397062 [details] [diff] [review] start_memory_uncommitted-v1.diff Review of attachment 8397062 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! ::: js/src/gc/Nursery.h @@ +207,5 @@ > + // Ensure our usable range is committed. > + if (numActiveChunks_ > 0) { > + bool result = gc::CommitAddressRange((void *)start(), gc::ChunkSize * nchunks); > + if (!result) > + return false; If we put off setting numActiveChunks_ until after this point, I think we can avoid crashing if this fails when we are trying to grow. We just won't grow the nursery and will continue with the previous size.
Attachment #8397062 - Flags: review?(jcoppeard) → review+
Attached patch start_nursery_unmapped-v2.diff (obsolete) (deleted) — Splinter Review
Rebased and applied review comments.
Attachment #8397062 - Attachment is obsolete: true
Attachment #8397302 - Flags: review+
Attached patch start_nursery_unmapped-v3.diff (obsolete) (deleted) — Splinter Review
I removed JS_GC_ZEAL from around POISON, so the poison patterns need to be moved under JS_CRASH_DIAGNOSTICS.
Attachment #8397302 - Attachment is obsolete: true
Attachment #8397327 - Flags: review+
Attached patch start_nursery_unmapped-v4.diff (deleted) — Splinter Review
Moving the assignment down means we don't have the right value yet.
Attachment #8397327 - Attachment is obsolete: true
Attachment #8397362 - Flags: review+
Keywords: checkin-needed
Hi terrence, sorry had to backout this change for bustage like https://tbpl.mozilla.org/php/getParsedLog.php?id=36861808&tree=Mozilla-Inbound
The M-oth spike was unrelated -- our existing decommit logic works well enough on all platforms to effectively reduce RSS by the amount we save from GGC: 10-15% across the board. Given that RSS is already down, it's not clear that this actually does anything other than complexify the logic.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: