Reviewers: Hannes Payer,
Message:
PTAL
Description:
Partially revert https://crrev.com/7e53749df0a10f475404e86ef0ca8df02bb79e7a
This fixes memory regression caused by not reducing new-space size.
BUG=chromium:517468
LOG=NO
Please review this at https://codereview.chromium.org/1273083002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+20, -3 lines):
M src/heap/gc-tracer.h
M src/heap/gc-tracer.cc
M src/heap/heap.cc
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index
a231a8eea2f57b4d1703a486bbd570ded0141a85..7dbe5fc2ee0f142a2ae88d636a1cb3bb1b3a2803
100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -702,11 +702,15 @@ size_t
GCTracer::AllocationThroughputInBytesPerMillisecond(
}
+size_t GCTracer::CurrentAllocationThroughputInBytesPerMillisecond() const {
+ return AllocationThroughputInBytesPerMillisecond(kThroughputTimeFrameMs);
+}
+
+
size_t
GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond()
const {
- static const double kThroughputTimeFrame = 5000;
return OldGenerationAllocationThroughputInBytesPerMillisecond(
- kThroughputTimeFrame);
+ kThroughputTimeFrameMs);
}
Index: src/heap/gc-tracer.h
diff --git a/src/heap/gc-tracer.h b/src/heap/gc-tracer.h
index
811266e92e29c4fbf45fc980db58fe72eaec1ac4..9f383bf890f5ca30eb8568521260461806cc80dd
100644
--- a/src/heap/gc-tracer.h
+++ b/src/heap/gc-tracer.h
@@ -299,6 +299,8 @@ class GCTracer {
typedef RingBuffer<SurvivalEvent, kRingBufferMaxSize>
SurvivalEventBuffer;
+ static const int kThroughputTimeFrameMs = 5000;
+
explicit GCTracer(Heap* heap);
// Start collecting data.
@@ -416,6 +418,11 @@ class GCTracer {
// Returns 0 if no allocation events have been recorded.
size_t AllocationThroughputInBytesPerMillisecond(double time_ms) const;
+ // Allocation throughput in heap in bytes/milliseconds in
+ // the last five seconds.
+ // Returns 0 if no allocation events have been recorded.
+ size_t CurrentAllocationThroughputInBytesPerMillisecond() const;
+
// Allocation throughput in old generation in bytes/milliseconds in
// the last five seconds.
// Returns 0 if no allocation events have been recorded.
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index
e37c9f6b11de8b333743e8f296486d3561721013..4647157e8e3443275064997d92c326207fe297cc
100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4763,7 +4763,13 @@ bool Heap::HasHighFragmentation(intptr_t used,
intptr_t committed) {
void Heap::ReduceNewSpaceSize() {
- if (!FLAG_predictable && HasLowAllocationRate()) {
+ // TODO(ulan): Unify this constant with the similar constant in
+ // GCIdleTimeHandler once the change is merged to 4.5.
+ static const size_t kLowAllocationThroughput = 1000;
+ size_t allocation_throughput =
+ tracer()->CurrentAllocationThroughputInBytesPerMillisecond();
+ if (FLAG_predictable || allocation_throughput == 0) return;
+ if (allocation_throughput < kLowAllocationThroughput) {
new_space_.Shrink();
UncommitFromSpace();
}
--
--
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.