Search code examples
javascriptweb-audio-api

Why does using an oscillator in the Web Audio API always leak memory in Chrome? bug?


I was under the impression that I only needed to stop the node, and remove all references to it.

The following code leaks memory in Chrome:

const context = new AudioContext();
for (var i = 0; i < 1000000; i++) {
    const node = context.createOscillator();
    node.start();
    node.stop();
}

However, it doesn't leak in Firefox.

Is there something wrong with my code, or is it just a bug in Chrome?


Solution

  • Looks like a bug in Chrome. Please file a bug at crbug.com/new.