[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/+/2169930
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67422}
This commit is contained in:
Ulan Degenbaev 2020-04-28 10:29:53 +02:00 committed by Commit Bot
parent aa9aac3c54
commit 3a50c708b9

View File

@ -3773,12 +3773,6 @@ void Heap::CheckMemoryPressure() {
GarbageCollectionReason::kMemoryPressure);
}
}
if (memory_reducer_) {
MemoryReducer::Event event;
event.type = MemoryReducer::kPossibleGarbage;
event.time_ms = MonotonicallyIncreasingTimeInMs();
memory_reducer_->NotifyPossibleGarbage(event);
}
}
void Heap::CollectGarbageOnMemoryPressure() {