Commit 2b8a40e1 authored by hpayer's avatar hpayer Committed by Commit bot

Reduce new space size during idle times only in memory mode after scavenge,...

Reduce new space size during idle times only in memory mode after scavenge, full gc, or finalized incremental full gc.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#28552}
parent 181d7b85
......@@ -4564,6 +4564,18 @@ void Heap::MakeHeapIterable() {
DCHECK(IsHeapIterable());
}
void Heap::ReduceNewSpaceSize(GCIdleTimeAction action) {
if (action.reduce_memory &&
(action.type == DO_SCAVENGE || action.type == DO_FULL_GC ||
(action.type == DO_INCREMENTAL_MARKING &&
incremental_marking()->IsStopped()))) {
new_space_.Shrink();
UncommitFromSpace();
}
}
bool Heap::TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects,
size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
......@@ -4685,10 +4697,7 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
break;
}
if (action.reduce_memory) {
new_space_.Shrink();
UncommitFromSpace();
}
ReduceNewSpaceSize(action);
return result;
}
......
......@@ -2127,6 +2127,8 @@ class Heap {
void SelectScavengingVisitorsTable();
void ReduceNewSpaceSize(GCIdleTimeAction action);
bool TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects,
size_t mark_compact_speed_in_bytes_per_ms);
......
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