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 <j83.kwon@samsung.com>
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);
}