commit 6fdac8d146dc7a2e6a965e38b39da6daf592dd13 Author: Jinwoo Kwon AuthorDate: Fri Apr 5 04:16:13 2024 +0000 Commit: Bot Blink CommitDate: Mon May 20 05:04:31 2024 +0000 [VD] Set hard limit for external memory increment In M94, garbage collection for ArrayBuffer's backing store is not frequently called enough on media playback scenario. This results in PSS memory hitting the limit of our product. This is due to the V8's logic, which dynamically increases and decreases the limit of external memory. When the external memory limit is increased too much, then V8 will not trigger a GC that clears external memory, resulting this issue. This patch sets a 300MB hard limit for external memory limit so that invoking external memory GC is guaranteed. Change-Id: Ief1555741b54b5a33937f7438cde64f06d5c8294 Signed-off-by: Jinwoo Kwon diff --git a/v8/src/heap/heap.h b/v8/src/heap/heap.h index eacb79ddf8a5..36808d6a6504 100644 --- a/v8/src/heap/heap.h +++ b/v8/src/heap/heap.h @@ -332,7 +332,17 @@ class Heap { total_.store(value, std::memory_order_relaxed); } +#if defined(OS_TIZEN_TV_PRODUCT) + // 300MB was decided to minify the GC call for meeting threshold + static constexpr int kExternalAllocationHardLimit = 300 * 1024 * 1024; +#endif + void set_limit(int64_t value) { +#if defined(OS_TIZEN_TV_PRODUCT) + if (value > kExternalAllocationHardLimit) { + return; + } +#endif limit_.store(value, std::memory_order_relaxed); }