<?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>201005</bug_id>
          
          <creation_ts>2019-08-21 16:09:20 -0700</creation_ts>
          <short_desc>[JSC] Prune about-to-be-notified rejected promises list at GC flip</short_desc>
          <delta_ts>2019-08-22 15:15:47 -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>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Kirsling">ross.kirsling</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>keith_miller</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1563778</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2019-08-21 16:09:20 -0700</bug_when>
    <thetext>From bug 197172 comment 36:

&gt; If you have a loop with:
&gt; 
&gt; let p = new Promise((resolve, reject) =&gt; {
&gt;     ...
&gt;     reject(p)
&gt; });
&gt;
&gt; p will be kept alive until the the microtasks are drained. Which means programs will OOM if they never drain all their microtasks...
&gt;
&gt; I think, at least, you&apos;ll need to clear handled promises at the GC flip. See where we call finalizeUnconditionalFinalizers.

Given the WHATWG spec*, I don&apos;t believe this is something we can address for the normal, web-hosted case (i.e. the &quot;unhandledrejection&quot; event), but it would be a possible improvement for rejection tracking in a standalone JSContext (which has no spec).

[*] https://html.spec.whatwg.org/multipage/webappapis.html#unhandled-promise-rejections</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>