Bug 262290 - Expose a way to report when extra memory in old region has increased in size
Summary: Expose a way to report when extra memory in old region has increased in size
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-28 02:04 PDT by Jarred Sumner
Modified: 2023-10-05 02:05 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarred Sumner 2023-09-28 02:04:50 PDT
Say you have a long-running task that writes to dynamically-sized non-GC'd buffers. Those buffers may increase in size after the parent cell moves from eden -> old space. This size increase would not be reported to the GC, causing extra memory to be under-reported to the GC.

The pattern of calling Heap::reportExtraMemoryAllocated and Heap::reportExtraMemoryVisited doesn't quite work for this case because the allocated size is dynamic.

Concrete example: streaming an HTTP response body. Each write from JS might have a delay and might need to be buffered. If the buffer doesn't have enough space, the buffer will grow, but the memory growth won't be reported to the garbage collector since the memory growth happened in native code after the initial allocation.
Comment 1 Radar WebKit Bug Importer 2023-10-05 02:05:13 PDT
<rdar://problem/116512291>