Commit 3a50c708 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Do not schedule follow-up GCs on memory pressure signal

Upon receiving a memory pressure signal V8 performs one GC and also
schedules three follow-up GCs. This may be problematic for performance
if the memory pressure signals are generated periodically.

This patch makes V8's memory pressure handler more lightweight by doing
only one GC.

Bug: chromium:1072746
Change-Id: I242534bd2c27a68188bb5e3a6b4092118c1b486c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2169930Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67422}
parent aa9aac3c
...@@ -3773,12 +3773,6 @@ void Heap::CheckMemoryPressure() { ...@@ -3773,12 +3773,6 @@ void Heap::CheckMemoryPressure() {
GarbageCollectionReason::kMemoryPressure); GarbageCollectionReason::kMemoryPressure);
} }
} }
if (memory_reducer_) {
MemoryReducer::Event event;
event.type = MemoryReducer::kPossibleGarbage;
event.time_ms = MonotonicallyIncreasingTimeInMs();
memory_reducer_->NotifyPossibleGarbage(event);
}
} }
void Heap::CollectGarbageOnMemoryPressure() { void Heap::CollectGarbageOnMemoryPressure() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment