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() { ...@@ -4564,6 +4564,18 @@ void Heap::MakeHeapIterable() {
DCHECK(IsHeapIterable()); 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( bool Heap::TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects, double idle_time_in_ms, size_t size_of_objects,
size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
...@@ -4685,10 +4697,7 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action, ...@@ -4685,10 +4697,7 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
break; break;
} }
if (action.reduce_memory) { ReduceNewSpaceSize(action);
new_space_.Shrink();
UncommitFromSpace();
}
return result; return result;
} }
......
...@@ -2127,6 +2127,8 @@ class Heap { ...@@ -2127,6 +2127,8 @@ class Heap {
void SelectScavengingVisitorsTable(); void SelectScavengingVisitorsTable();
void ReduceNewSpaceSize(GCIdleTimeAction action);
bool TryFinalizeIdleIncrementalMarking( bool TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects, double idle_time_in_ms, size_t size_of_objects,
size_t mark_compact_speed_in_bytes_per_ms); 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