Commit 1c763945 authored by ulan@chromium.org's avatar ulan@chromium.org

Do full GC for small heaps in idle time handler.

BUG=407593
LOG=N
R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/563573002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23871 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 032bc4bd
......@@ -80,7 +80,9 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
if (heap_state.incremental_marking_stopped) {
if (idle_time_in_ms >= EstimateMarkCompactTime(
heap_state.size_of_objects,
heap_state.mark_compact_speed_in_bytes_per_ms)) {
heap_state.mark_compact_speed_in_bytes_per_ms) ||
(heap_state.size_of_objects < kSmallHeapSize &&
heap_state.contexts_disposed > 0)) {
// If there are no more than two GCs left in this idle round and we are
// allowed to do a full GC, then make those GCs full in order to compact
// the code space.
......
......@@ -98,6 +98,10 @@ class GCIdleTimeHandler {
// Number of scavenges that will trigger start of new idle round.
static const int kIdleScavengeThreshold;
// Heap size threshold below which we prefer mark-compact over incremental
// step.
static const size_t kSmallHeapSize = 2 * kPointerSize * MB;
struct HeapState {
int contexts_disposed;
size_t size_of_objects;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment