Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cffeaa6ccbf42e8d5ff626cc9806f7eac3c66e6b
      
https://github.com/WebKit/WebKit/commit/cffeaa6ccbf42e8d5ff626cc9806f7eac3c66e6b
  Author: Marcus Plutowski <[email protected]>
  Date:   2026-05-29 (Fri, 29 May 2026)

  Changed paths:
    M Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.cpp
    M Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.h
    M Source/JavaScriptCore/runtime/JSCConfig.h
    M Source/JavaScriptCore/runtime/StructureID.h

  Log Message:
  -----------
  Scale down structure-heap reservation size with physical memory
https://bugs.webkit.org/show_bug.cgi?id=315240
rdar://177567438

Reviewed by Mark Lam.

This patch constrains the size of the StructureAlignedMemoryAllocator's
VA reservation so that it does not exceed 25% of the system's physical
memory size. The goal is to reduce virtual memory usage in cases where
we know that the full reservation would not be used (as we do not expect
to use e.g. 50% of system memory on JS Structures in a single process).
For most systems, this will not have a significant effect, as the
reservation size is already small relative to RAM, but on e.g. a 3GiB
iPad the reservation can currently be as big as 2GiB -- this patch will
reduce that to a maximum of 0.5GiB. The restriction only takes affect
for devices with embedded operating systems, and even there only in
processes which lack the
com.apple.developer.kernel.extended-virtual-addressing entitlement.
When that entitlement is present there is no restriction.
New reservation size by RAM size:
  - 3GiB RAM: 512MiB reservation
  - 4GiB RAM: 512MiB reservation
  - 5GiB RAM: 1GiB reservation
  - 6GiB RAM: 1GiB reservation
  ... 1GiB reservation ...
  - 10GiB RAM: 2GiB reservation
  and 2GiB thereafter.

Canonical link: https://commits.webkit.org/314156@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to