Commit 2995df7d authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[api] Fix AdjustAmountOfExternalAllocatedMemory memory reducer

The reduer should only fire on increasing memory.

R=ulan@chromium.org

Change-Id: I4abd956ea14730b223724a01af819be574b1aa3a
Reviewed-on: https://chromium-review.googlesource.com/c/1308354Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57149}
parent 81ee4aa9
...@@ -10406,7 +10406,9 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( ...@@ -10406,7 +10406,9 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
*external_memory = amount; *external_memory = amount;
int64_t allocation_diff_since_last_mc = int64_t allocation_diff_since_last_mc =
*external_memory_at_last_mc - *external_memory; *external_memory - *external_memory_at_last_mc;
// Only check memory pressure and potentially trigger GC if the amount of
// external memory increased.
if (allocation_diff_since_last_mc > kMemoryReducerActivationLimit) { if (allocation_diff_since_last_mc > kMemoryReducerActivationLimit) {
CheckMemoryPressure(); CheckMemoryPressure();
} }
......
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