Revision: 24851
Author: [email protected]
Date: Thu Oct 23 15:16:27 2014 UTC
Log: Shrink new space in idle notification.
BUG=chromium:424423
LOG=Y
[email protected]
Review URL: https://codereview.chromium.org/662543008
https://code.google.com/p/v8/source/detail?r=24851
Modified:
/branches/bleeding_edge/src/heap/heap.cc
/branches/bleeding_edge/src/heap/heap.h
=======================================
--- /branches/bleeding_edge/src/heap/heap.cc Thu Oct 23 08:43:17 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.cc Thu Oct 23 15:16:27 2014 UTC
@@ -1570,6 +1570,8 @@
LOG(isolate_, ResourceEvent("scavenge", "end"));
gc_state_ = NOT_IN_GC;
+
+ gc_idle_time_handler_.NotifyScavenge();
}
@@ -4299,6 +4301,23 @@
}
DCHECK(IsHeapIterable());
}
+
+
+void Heap::IdleMarkCompact(const char* message) {
+ bool uncommit = false;
+ if (gc_count_at_last_idle_gc_ == gc_count_) {
+ // No GC since the last full GC, the mutator is probably not active.
+ isolate_->compilation_cache()->Clear();
+ uncommit = true;
+ }
+ CollectAllGarbage(kReduceMemoryFootprintMask, message);
+ gc_idle_time_handler_.NotifyIdleMarkCompact();
+ gc_count_at_last_idle_gc_ = gc_count_;
+ if (uncommit) {
+ new_space_.Shrink();
+ UncommitFromSpace();
+ }
+}
void Heap::TryFinalizeIdleIncrementalMarking(
@@ -4309,20 +4328,7 @@
gc_idle_time_handler_.ShouldDoMarkCompact(
idle_time_in_ms, size_of_objects,
mark_compact_speed_in_bytes_per_ms))) {
- bool uncommit = false;
- if (gc_count_at_last_idle_gc_ == gc_count_) {
- // No GC since the last full GC, the mutator is probably not active.
- isolate_->compilation_cache()->Clear();
- uncommit = true;
- }
- CollectAllGarbage(kReduceMemoryFootprintMask,
- "idle notification: finalize incremental");
- gc_idle_time_handler_.NotifyIdleMarkCompact();
- gc_count_at_last_idle_gc_ = gc_count_;
- if (uncommit) {
- new_space_.Shrink();
- UncommitFromSpace();
- }
+ IdleMarkCompact("idle notification: finalize incremental");
}
}
@@ -4392,11 +4398,14 @@
}
case DO_FULL_GC: {
HistogramTimerScope scope(isolate_->counters()->gc_context());
- const char* message = contexts_disposed_
- ? "idle notification: contexts disposed"
- : "idle notification: finalize idle round";
- CollectAllGarbage(kReduceMemoryFootprintMask, message);
- gc_idle_time_handler_.NotifyIdleMarkCompact();
+ if (contexts_disposed_) {
+ CollectAllGarbage(kReduceMemoryFootprintMask,
+ "idle notification: contexts disposed");
+ gc_idle_time_handler_.NotifyIdleMarkCompact();
+ gc_count_at_last_idle_gc_ = gc_count_;
+ } else {
+ IdleMarkCompact("idle notification: finalize idle round");
+ }
break;
}
case DO_SCAVENGE:
=======================================
--- /branches/bleeding_edge/src/heap/heap.h Wed Oct 22 06:58:38 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.h Thu Oct 23 15:16:27 2014 UTC
@@ -1975,6 +1975,8 @@
void SelectScavengingVisitorsTable();
+ void IdleMarkCompact(const char* message);
+
void TryFinalizeIdleIncrementalMarking(
size_t idle_time_in_ms, size_t size_of_objects,
size_t mark_compact_speed_in_bytes_per_ms);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.