Bug 134606 - Audio Context isn't being collected sufficiently eagerly.
Summary: Audio Context isn't being collected sufficiently eagerly.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2014-07-03 12:34 PDT by Gprog
Modified: 2019-08-09 15:59 PDT (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Gprog 2014-07-03 12:34:03 PDT
If I do this as below , after I click on the "TEST 1" button, it creates Audio Context thread but if I click it again it doesn't destroy the older Audio Context object rather creates another Audio Context (spawning another thread) on top of it. 
After doing this multiple times, it fails because of the cap limit on the number of Audio Context that can be created simultaneously.

I also tried forcing a Javascript GC (calling JSC::Heap::collectAllGarbage) by opening the inspector window but it doesn't clear these Audio Context objects which are there until I do a reload on the page which calls JSC::Heap::collectAllGarbage and clear off all the Audio Context objects created.

<h4> WEB AUDIO TEST </h4>
<canvas id='canvas' width='800px' height='500px'></canvas>
<button type="button" onclick="test()" width="200" height="300">TEST 1</button>
<script type='text/javascript'>
function test()
		var testCtx = new webkitAudioContext();
		var audioSource = testCtx.createBufferSource();