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

Unified Diff: src/heap/heap.cc

Issue 1105293004: Add mode to reduce memory usage in idle notification. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add checks in tests 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/gc-idle-time-handler.cc ('k') | test/cctest/test-heap.cc » ('j') | 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 a1e2e1671e42c0e7072e05fa194688400a41e296..4d5ea7a8826c7bbf4fd4b383168423518bed137e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -907,6 +907,13 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
if (collector == MARK_COMPACTOR && FLAG_track_detached_contexts) {
isolate()->CheckDetachedContextsAfterGC();
}
+
+ if (collector == MARK_COMPACTOR) {
+ gc_idle_time_handler_.NotifyMarkCompact();
+ } else {
+ gc_idle_time_handler_.NotifyScavenge();
+ }
+
tracer()->Stop(collector);
}
@@ -1634,8 +1641,6 @@ void Heap::Scavenge() {
LOG(isolate_, ResourceEvent("scavenge", "end"));
gc_state_ = NOT_IN_GC;
-
- gc_idle_time_handler_.NotifyScavenge();
}
@@ -4570,6 +4575,7 @@ bool Heap::TryFinalizeIdleIncrementalMarking(
static_cast<size_t>(idle_time_in_ms), size_of_objects,
final_incremental_mark_compact_speed_in_bytes_per_ms))) {
CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
+ gc_idle_time_handler_.NotifyIdleMarkCompact();
ReduceNewSpaceSize(is_long_idle_notification);
return true;
}
@@ -4650,6 +4656,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
break;
case DO_INCREMENTAL_MARKING: {
if (incremental_marking()->IsStopped()) {
+ // TODO(ulan): take reduce_memory into account.
incremental_marking()->Start();
}
double remaining_idle_time_in_ms = 0.0;
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698