<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>297533</bug_id>
          
          <creation_ts>2025-08-18 07:40:34 -0700</creation_ts>
          <short_desc>[Win] Faster memory pressure handler</short_desc>
          <delta_ts>2026-05-14 15:45:58 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 11</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=146685</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian Grunert">ian.grunert</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2137150</commentid>
    <comment_count>0</comment_count>
    <who name="Ian Grunert">ian.grunert</who>
    <bug_when>2025-08-18 07:40:34 -0700</bug_when>
    <thetext>When running the layout tests the system runs so low on memory that it can&apos;t run ruby:

ScriptError raised: Failed to run &quot;[&apos;ruby&apos;, &apos;--version&apos;]&quot; exit_code: 3221226505 (from worker/5)

The current memory pressure handler runs once per minute. Ideally we&apos;d use a wait function or similar so we can clear memory as soon as the LowMemoryResourceNotification triggers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2137152</commentid>
    <comment_count>1</comment_count>
    <who name="Ian Grunert">ian.grunert</who>
    <bug_when>2025-08-18 07:57:41 -0700</bug_when>
    <thetext>I think the current memory pressure handler might also run once and then uninstall the timer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2137170</commentid>
    <comment_count>2</comment_count>
    <who name="Ian Grunert">ian.grunert</who>
    <bug_when>2025-08-18 10:46:17 -0700</bug_when>
    <thetext>Also it looks like platformInitialize() is never called, so m_lowMemoryHandle is never initialized.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138606</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-08-25 07:41:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/159104225&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140680</commentid>
    <comment_count>4</comment_count>
    <who name="Ian Grunert">ian.grunert</who>
    <bug_when>2025-09-03 11:46:19 -0700</bug_when>
    <thetext>https://searchfox.org/firefox-main/source/xpcom/base/AvailableMemoryWatcherWin.cpp#222-242

I think we should be able to use RegisterWaitForSingleObject, and when we get the callback enqueue a one-shot timer to call the scavenger.

This is lower priority now, as ENABLE_PERIODIC_MEMORY_MONITOR has been enabled for Windows.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2211032</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-14 15:45:56 -0700</bug_when>
    <thetext>Committed 313270@main (dc311bb8313d): &lt;https://commits.webkit.org/313270@main&gt;

Reviewed commits have been landed. Closing PR #63320 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>