Addressed comments and tuned heuristics for starting and finishing the idle round.
Could you please take another look? http://codereview.chromium.org/8519002/diff/9002/src/heap.cc File src/heap.cc (right): http://codereview.chromium.org/8519002/diff/9002/src/heap.cc#newcode4497 src/heap.cc:4497: if (mark_sweeps_since_idle_round_started_ >= kMaxMarkSweepsInIdleRound) { On 2011/11/22 12:29:26, Erik Corry wrote:
This test is also included in WorthStartingGCWhenIdle. Do we need it
both
places?
Removed the test from WorthStartingGCWhenIdle. http://codereview.chromium.org/8519002/diff/9002/src/heap.cc#newcode4499 src/heap.cc:4499: return true; On 2011/11/22 12:29:26, Erik Corry wrote:
If sweeping is not complete we should not return here.
Moved the sweeping steps up. http://codereview.chromium.org/8519002/diff/9002/src/heap.cc#newcode4524 src/heap.cc:4524: if (gc_count_at_last_idle_gc_ == gc_count_) { On 2011/11/22 12:29:26, Erik Corry wrote:
It would be nice with a comment that explained the thinking behind
this
condition.
Done. http://codereview.chromium.org/8519002/diff/16001/src/heap.cc File src/heap.cc (right): http://codereview.chromium.org/8519002/diff/16001/src/heap.cc#newcode150 src/heap.cc:150: scavenges_since_last_idle_round_(kIdleScavengeThreshold), The initial value allows to start the idle round on the first idle notification. http://codereview.chromium.org/8519002/diff/16001/src/heap.cc#newcode4511 src/heap.cc:4511: if (hint < 1000 && !WorthStartingGCWhenIdle()) { If hint >= 1000 then the embedder is asking us to do a lot of GC work. This helps to reduce the memory usage in Chrome memory tests. http://codereview.chromium.org/8519002/diff/16001/src/heap.h File src/heap.h (right): http://codereview.chromium.org/8519002/diff/16001/src/heap.h#newcode1781 src/heap.h:1781: return (scavenges_since_last_idle_round_ >= kIdleScavengeThreshold); The previous version would fail to start the idle round if there were many scavenges followed by a full GC, which did not collect all garbage because of weak external references. In this case another full GC could collect more garbage. http://codereview.chromium.org/8519002/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
