New issue
Advanced search Search tips

Issue 595342 link

Starred by 8 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

GC not getting trigerred when memory gets low - extension crashing

Reported by akrishnamoorthy@broadsoft.com, Mar 16 2016

Issue description

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

Steps to reproduce the problem:
1. Load the attached Chrome extension
2. Open a new tab which will load this extension. The screen choosing dialog will appear for the desktopShareCapture command in the extension.
3. Choose any screen or application from the dialog. The extension starts within 3 seconds.
4. Leave the extension to continue for sometime (about 10 minutes). The extension crashes

What is the expected behavior?
The GC to get triggered whenever the available space in the application gets too low.

When the Collect Garbage button the Timeline panel of DevTools of Chrome is clicked the memory is reclaimed, which clearly show that Chrome is not triggering the GC even when the memory gets too low.

What went wrong?

Would there any difference in the time frame when the GC gets triggered for the Chrome extension installed on different machines ??

We have tried tuning the code and the code is tuned to the extent as much as we can. We are using plain JS on Chrome extension.

In few machines GC is not getting trigered causing the extension to crash. We have printed the available space from the chrome.system.memory.getInfo API. When this available space becomes too low, GC is reclaiming the space back but in few machine this is not occurring forcing the application to crash.

On seeing the Memory graph in the Timeline window of Chrome devtools, the GC to clean Heapspace is getting triggered very late in the machines where the extension is crashing.

We see when the available space becomes too low, the application crashes. 

WebStore page: https://chrome.google.com/webstore/search/abepocpaidbjckekfhgkmblflkfcceif

Did this work before? No 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

1. Would like to know if there is a way to force the GC to trigger from Chrome extension ?
2. Would there be any difference in the time when the GC gets triggered for the same extension in different machines ?
3. Is there any setting in the Chrome to set the GC trigger intervals ?

The zip attached here prints the available space at different points of execution.
 
ScreenShareExtension.zip
17.5 KB Download

Comment 1 by phistuck@gmail.com, Mar 17 2016

I have noticed something similar with Outlook.com Nofitier -
https://chrome.google.com/webstore/detail/outlookcom-notifier/hemiodgbhhdpmlebdkhpjiejfadplbip

I reduced it down to the background page calling document.createDocumentFragment with the HTML of Outlook.com. The memory usage increases as time goes by and never gets collected. Collecting manually (using the Timeline panel) reduces the memory back to a normal amount.
Components: Blink>Memory
Status: Untriaged (was: Unconfirmed)
I believe the underlying issue is that background pages do not trigger garbage collection as often (or at all?) as normal pages.
Tracked the crash with Crash reports on. Here is a crash id for reference, in case if that is helpful.

****DO NOT CHANGE BELOW THIS LINE****
report_id:2a2a367400000000
Components: -Blink>Memory Blink>MemoryAllocator>GarbageCollection
Guys,

Could we get to know if there a fix planned for this bug ?
Owner: lazyboy@chromium.org
Status: Assigned (was: Untriaged)
Assigning to lazyboy@ since he was looking at a somewhat related problem the other day
I think Chrome 58.0.3029.81 (on Windows 8.1) still has this bug. I have an extension that according to Chrome Task Manager was using 570 MB of memory. When I opened the background page and triggered manual GC, the memory dropped to 70 MB. But it did not happen automatically. The extension was using that 570 MB (and growing slowly) for several hours.

Like Comment 2 says, it appears that deep GC isn't triggered at all for extension background pages?

Sign in to add a comment