Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 813de3956c01bcc5a7a80f566ae8598184fe6c08
https://github.com/WebKit/WebKit/commit/813de3956c01bcc5a7a80f566ae8598184fe6c08
Author: Keith Miller <[email protected]>
Date: 2025-11-14 (Fri, 14 Nov 2025)
Changed paths:
M Source/JavaScriptCore/heap/Heap.cpp
Log Message:
-----------
GC should sweep synchronously when memory is critical
https://bugs.webkit.org/show_bug.cgi?id=302466
rdar://164634841
Reviewed by Yusuke Suzuki.
Our sweeping heuristics mostly rely on the fact that workloads tend to allocate
the same sets of objects over time. When they don't, we expect that the
incremental sweeper will clean it up eventually. However, in JetStream 3 the
working set of objects changes over time and the incremental sweeper doesn't
run because there's not much idle time.
This leads to a pathological case in JS3 where the GC thinks the heap is
roughly 300MB but the footprint of the process is 1.5GB. We should address
this in a more comprehensive way in the future but for now we should have
a stopgap to sweep synchronously after a GC when memory is critical.
Also, don't give an oversized eden after an oportunistic task GC when critical.
Finally, remove some `#if USE(BMALLOC_MEMORY_FOOTPRINT_API)` guards since
`overCriticalMemoryThreshold` always returns false when not using that API
anyway.
No new tests, allows JS3 to run on iPhone 11/12.
Canonical link: https://commits.webkit.org/303051@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications