New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 716800 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 1
Type: Bug



Sign in to add a comment

OfflineAudioContext does not get Garbage Collected correctly

Reported by rau...@gmail.com, Apr 29 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce the problem:
1. Run the following JS in a page or in the console.
2. setInterval(function()
{
    var sampleOfflineContext = new OfflineAudioContext(1, 1024, 12000);
    delete sampleOfflineContext;
}, 25);
3. Watch memory usage grow until crash (will occur after a few minutes, depending on hardware)

What is the expected behavior?
No memory leak / does not crash.

What went wrong?
I get the 'awe snap' page after a few minutes.
I am using a OfflineAudioContext to downsample an audio stream from a Microphone. Because I must create a new context for every buffer, I run out of memory for the tab in just a few minutes. 

Did this work before? No 

Does this work in other browsers? No
 FireFox Browser will crash after some time with an out of memory error when running the provided JS. 

Chrome version: 58.0.3029.81  Channel: stable
OS Version: 10.0
Flash Version: 

This or a similar issue was reported here: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-bugs/PbyBjHdsP98

A workaround for my usecase would be to implement this:
https://bugs.chromium.org/p/chromium/issues/detail?id=432248
 
Labels: -Pri-2 Needs-Bisect Needs-Triage-M58 Prestable-58.0.3029.81 Pri-1
Cc: hdodda@chromium.org
Labels: -OS-Windows -Needs-Bisect -Needs-Triage-M58 M-60 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Tested the issue on Mac OS 10.12.3 , ubuntu 14.04 using chrome stable M58 #58.0.3029.81 and M60 #60.0.3087.0 and issue is reproduced.Attached screencast of the issue.

Issue is seen from M45 #45.0.2404.0 and from M40 to M30 , issue behavior is different.

Issue is not reproduced on windows 7 & 10 both desktop and laptops.

Marking it as untraiged for further inputs on this.

Thanks!



716800.mp4
1.7 MB View Download

Comment 3 by rtoy@chromium.org, May 16 2017

The crash is not because it's out of memory.  It looks like it's out of threads, based on the error message printed when the tab crashes:

[1:1:0516/152929.544823:ERROR:platform_thread_posix.cc(119)] pthread_create: Resource temporarily unavailable
[1:1:0516/152929.545373:FATAL:webthread_impl_for_worker_scheduler.cc(32)] Check failed: started.

But we should certainly GC all of these nodes that are never started and clean up the threads so that more can be created.  This, however, depends on GC happening often enough to do that.
Project Member

Comment 4 by bugdroid1@chromium.org, May 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6d697f84c040b2cf41e6d1f90a7b123c496bd836

commit 6d697f84c040b2cf41e6d1f90a7b123c496bd836
Author: hongchan <hongchan@chromium.org>
Date: Thu May 25 00:39:54 2017

Lazy initialization of the rendering thread in OfflineAudioContext

This CL changes the timing of thread initialization in
OfflineAudioDestinationNode after starting the actual rendering. This
prevents out-of-threads situation from happening particularly when user
creates thousands of OfflineAudioContexts upfront.

BUG= 723838 ,  716800 
TEST=LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-creation.html

Review-Url: https://codereview.chromium.org/2889393003
Cr-Commit-Position: refs/heads/master@{#474494}

[add] https://crrev.com/6d697f84c040b2cf41e6d1f90a7b123c496bd836/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-smoke-test.html
[modify] https://crrev.com/6d697f84c040b2cf41e6d1f90a7b123c496bd836/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
[modify] https://crrev.com/6d697f84c040b2cf41e6d1f90a7b123c496bd836/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
[modify] https://crrev.com/6d697f84c040b2cf41e6d1f90a7b123c496bd836/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.h

Comment 5 by rtoy@chromium.org, May 25 2017

Status: Available (was: Untriaged)
re #5, rtoy@ can you clarify why this is "Available" even after we landed a fix?

Comment 7 by rtoy@chromium.org, Mar 19 2018

Status: Fixed (was: Available)
Oops.  It should be closed.

Sign in to add a comment