The default bug view has changed. See this FAQ.

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: Igor Bukanov, Assigned: gwagner)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

7 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 531479 [details] [diff] [review]
patch
Assignee: igor → anygregor
(Assignee)

Comment 2

6 years ago
Created attachment 531481 [details] [diff] [review]
patch
Attachment #531479 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Attachment #531481 - Flags: review?(igor)
(Assignee)

Updated

6 years ago
Blocks: 656120
(Reporter)

Comment 3

6 years ago
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.
(Assignee)

Comment 4

6 years ago
Created attachment 531488 [details] [diff] [review]
patch

update
Attachment #531481 - Attachment is obsolete: true
Attachment #531488 - Flags: review?(igor)
Attachment #531481 - Flags: review?(igor)
(Reporter)

Comment 5

6 years ago
Comment on attachment 531488 [details] [diff] [review]
patch

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

Nice!
Attachment #531488 - Flags: review?(igor) → review+
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/tracemonkey/rev/b83c8374358a
Whiteboard: fixed-in-tracemonkey
hg.mozilla.org/mozilla-central/rev/b83c8374358a
Status: NEW → RESOLVED
Last Resolved: 6 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.