[Webkit-unassigned] [Bug 106621] Web Audio Api noteoff/stop is not releasing memory - crash

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 11 10:42:02 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=106621


Chris Rogers <crogers at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Chris Rogers <crogers at google.com>  2013-01-11 10:43:53 PST ---
(In reply to comment #0)
> Large or small. oneshot sources are not releasing buffers and will eat whole ram.
> unfortunately there is no way to do it manually like it is in webgl right now.
> following sample crashes webkit both mobile and dektop.as result of memory depletion ?
> current ipad2 mobile safari ios 6.0.1 crash after 8 oneshots played.
> current chrome 24.0.1312.52m crash after  17 oneshots played.
> 
> 
> var context = new webkitAudioContext();
> var total=0;
> 
> function onTouchStart(){
>     setInterval(function(){
>     total+=10;
>     var source = context.createBufferSource();    
>     source.connect(context.destination);
>     source.buffer=context.createBuffer(1, 10*1024*1024, context.sampleRate);

It's very unusual to create a "new" distinct buffer for playing each sound.  It's much better to 
create a single buffer, then use the same one for each AudioBufferSourceNode.

This is a very artificial test which creates very huge buffers, which will of course eat up memory very quickly.
It's also possible to do this in a number of other ways such as creating huge Float32Arrays, etc.

>     source.noteOn(0);
>     source.noteOff(0); // acording to w3c spec resources should be deleted immediately.
>     console.log(total,'mb'); 
>     },1000);
> }
> 
> document.addEventListener( "touchstart", onTouchStart );
> document.addEventListener( "click", onTouchStart );

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list