Closed Bug 603916 Opened 14 years ago Closed 13 years ago

unifying GC scheduling

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: gwagner)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

The changes from the bug 602534 strongly hint that we should unify GC_ARENA_ALLOCATION_TRIGGER/GC_HEAP_GROWTH_FACTOR together with gcTriggerFactor and with maybegc heuristics. The suggested formula for running the next GC based on the current heuristics is:

run_gc_threshold = max(memory_usage_after_the_last_GC * factor, min_usage);

where min_usage and factor are tunable parameters.

Note that this bug is not about tuning the factors, but rather about replacing the current heuristics by single formula.






+++ This bug was initially created as a clone of Bug #602534 +++

Currently the scheduling of the last ditch is spreed through few allocation functions in jsgc.cpp. That makes it harder to follow. We should simplify that.
Attached patch patch (obsolete) — Splinter Review
Assignee: igor → anygregor
Attached patch patch (obsolete) — Splinter Review
Attachment #531479 - Attachment is obsolete: true
Attachment #531481 - Flags: review?(igor)
Blocks: 656120
Comment on attachment 531479 [details] [diff] [review]
patch

> JSRuntime::setGCLastBytes(size_t lastBytes)
>+    size_t trigger = Max(lastBytes, GC_ARENA_ALLOCATION_TRIGGER) * GC_HEAP_GROWTH_FACTOR;

* can overflow on 32 bits. I guess using floats for now should be fine.

>+    gcTriggerBytes = (gcMaxBytes < trigger) ? gcMaxBytes : trigger;

Nit: use Min here.

r+ with that.
Attached patch patchSplinter Review
update
Attachment #531481 - Attachment is obsolete: true
Attachment #531488 - Flags: review?(igor)
Attachment #531481 - Flags: review?(igor)
Comment on attachment 531488 [details] [diff] [review]
patch

Review of attachment 531488 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!
Attachment #531488 - Flags: review?(igor) → review+
http://hg.mozilla.org/tracemonkey/rev/b83c8374358a
Whiteboard: fixed-in-tracemonkey
hg.mozilla.org/mozilla-central/rev/b83c8374358a
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Summary: unifying GC sheduling → unifying GC scheduling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: