Closed
Bug 730447
Opened 13 years ago
Closed 13 years ago
GC: Create a real counter for malloc bytes
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: billm, Assigned: billm)
References
Details
Attachments
(1 file)
11.56 KB,
patch
|
gwagner
:
review+
|
Details | Diff | Splinter Review |
This is work toward bug 681479.
Right now we do a GC whenever 100MB of malloc memory has been allocated. This patch tries to improve this heuristic. It keeps a count of how many malloc bytes are allocated at any time. This requires that callers of free know how many bytes are being freed. It seems like in all the important cases, we know this. Once we know how many malloc bytes there are, we can use the usual heuristic of GCing when malloc bytes reach lastMallocBytes*3.
The big advantage of this approach is that we can track any malloc bytes, even if they're very short-lived. The check whether to do a GC or not happens in MaybeGC. So even if lots of memory is allocated and then quickly freed, it won't cause a GC as long as a MaybeGC doesn't happen in between.
I'm hoping this will allow people in Gecko to inform the JS engine of all malloc bytes, regardless of whether they're GCable or not. This should help a lot in cases where a GC would free lots of objects, but we're just not smart enough to GC right now.
Attachment #600527 -
Flags: review?(anygregor)
Comment 1•13 years ago
|
||
Thanks for doing this--we've had several bad GC bugs in the past because of the old, inaccurate, accounting.
Blocks: 730177
Comment 2•13 years ago
|
||
Comment on attachment 600527 [details] [diff] [review]
patch
Where is triggerMallocGC used?
Attachment #600527 -
Flags: review?(anygregor) → review+
Assignee | ||
Comment 3•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e4f70bd4f96d
I took out triggerMallocGC. It wasn't supposed to be there.
Target Milestone: --- → mozilla13
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•