Web Audio performance degrades after creating many running nodes, which should be garbage collected when not observable
Categories
(Core :: Web Audio, defect, P3)
Tracking
()
People
(Reporter: yotammann, Unassigned)
References
(Depends on 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36
Steps to reproduce:
Open up this page: https://codesandbox.io/s/patient-thunder-wtjqi
Let it run for a few hundred iterations
Actual results:
Performance of the page slowly gets worse as it eats up more and more CPU until eventually the audio crackles and goes silent.
Expected results:
The audio should be able to run in this state forever.
My guess is that the oscillator which is connected to the detune signal is never garbage collected. I think according to the spec, unreachable nodes should be garbage collected and once the main oscillator is stopped, the connected detune oscillator should also be garbage collected. This does not seem to be happening. here. A similar performance degradation happens if a ConstantSourceNode is connected to the detune and started.
Reporter | ||
Comment 1•5 years ago
|
||
Should have mentioned in the "Steps to reproduce", that in the example codesandbox, you have to hit 'start' in order to start the audio.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•4 years ago
|
As a workaround you can add a call to detuneNode.stop(now+4)
and it will no longer leak.
Description
•