Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: src/heap/heap.cc

Issue 1143973003: Reduce new space size during idle times only in memory mode after scavenge, full gc, or finalized i… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index e801ff94cfb3ab9f4593712a68c62960a6748f3f..df12e79beaaf030d3d1039d079f701d461c8dec4 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -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 ||
ulan 2015/05/21 12:29:31 what about DO_NOTHING and DONE?
Hannes Payer (out of office) 2015/05/21 12:31:08 I think it just makes sense after an actual GC, be
+ (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;
}
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698