Bug 156624 - ConvolverNode never releases memory after use
Summary: ConvolverNode never releases memory after use
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari Technology Preview
Hardware: Macintosh OS X 10.11
: P2 Major
Assignee: Nobody
Depends on:
Reported: 2016-04-15 05:13 PDT by Bjorn M
Modified: 2016-04-15 21:39 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Bjorn M 2016-04-15 05:13:13 PDT
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:


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: https://bugs.chromium.org/p/chromium/issues/detail?id=603256