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/gc-tracer.cc

Issue 1148633005: Uncommit and shrink semi-spaces only on low allocation rate. (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/gc-tracer.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index 927915d7554bae15b4e26c43b997734824f8c231..815baa440c308bf4fd619929e74a09db7fa11cf3 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -610,7 +610,7 @@ size_t GCTracer::NewSpaceAllocatedBytesInLast(double time_ms) const {
++iter;
}
- if (durations < time_ms) return 0;
+ if (durations == 0.0) return 0;
bytes = static_cast<size_t>(bytes * (time_ms / durations) + 0.5);
// Return at least 1 since 0 means "no data".
@@ -618,6 +618,15 @@ size_t GCTracer::NewSpaceAllocatedBytesInLast(double time_ms) const {
}
+size_t GCTracer::CurrentNewSpaceAllocationThroughputInBytesPerMillisecond()
+ const {
+ static const double kThroughputTimeFrame = 5000;
+ size_t allocated_bytes = NewSpaceAllocatedBytesInLast(kThroughputTimeFrame);
+ if (allocated_bytes == 0) return 0;
+ return static_cast<size_t>((allocated_bytes / kThroughputTimeFrame) + 1);
+}
+
+
double GCTracer::ContextDisposalRateInMilliseconds() const {
if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0;
« no previous file with comments | « src/heap/gc-tracer.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698