[webkit-reviews] review granted: [Bug 172186] [iOS] The Garbage Collector shouldn't rely on the bmalloc scavenger for up to date memory footprint info : [Attachment 310304] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 16 15:19:55 PDT 2017
Filip Pizlo <fpizlo at apple.com> has granted Michael Saboff <msaboff at apple.com>'s
request for review:
Bug 172186: [iOS] The Garbage Collector shouldn't rely on the bmalloc scavenger
for up to date memory footprint info
https://bugs.webkit.org/show_bug.cgi?id=172186
Attachment 310304: Patch
https://bugs.webkit.org/attachment.cgi?id=310304&action=review
--- Comment #4 from Filip Pizlo <fpizlo at apple.com> ---
Comment on attachment 310304
--> https://bugs.webkit.org/attachment.cgi?id=310304
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=310304&action=review
> Source/JavaScriptCore/heap/Heap.cpp:519
> - if (bmalloc::api::percentAvailableMemoryInUse() >
Options::criticalGCMemoryThreshold())
> + static unsigned memCalls = 0;
> +
> + bmalloc::MemoryDataAge memoryDataAge =
bmalloc::MemoryDataAge::UseCached;
> +
> + if (++memCalls >= 100) {
> + memoryDataAge = bmalloc::MemoryDataAge::GetCurrent;
> + memCalls = 0;
> + }
> +
> + if (bmalloc::api::percentAvailableMemoryInUse(memoryDataAge) >
Options::criticalGCMemoryThreshold())
> return true;
This is a nice heuristic!
More information about the webkit-reviews
mailing list