<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ConvolverNode never releases memory after use"
   href="https://bugs.webkit.org/show_bug.cgi?id=156624">156624</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ConvolverNode never releases memory after use
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari Technology Preview
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>OS X 10.11
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Audio
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bjorn.melinder&#64;soundtrap.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>ConvolverNodes potentially allocate a lot of memory when assigned a buffer. It seems this memory is never released after use or after setting the buffer to null. On iOS Mobile Safari this causes low memory warnings and crashes. On Safari for Mac it can lead to allocation of 10G+ and crashing too. To reproduce:

<a href="https://jsfiddle.net/2eqq65mo/">https://jsfiddle.net/2eqq65mo/</a>

I would expect conv.buffer = null to release the memory. It would be good if there was such an eager way of releasing the memory without having to wait for the next javascript GC.

I would also expect the javascript GC (or the variable going out of scope in the example above) to trigger the release. However, it seems the memory is not released by javascript GC. I'm guessing the ConvolverNodes are released whereas the underlying Reverb objects are not. 

When used in an OfflineAudioContext, the memory is never released either.

FYI I filed the same bug for Chrome as well: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=603256">https://bugs.chromium.org/p/chromium/issues/detail?id=603256</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>