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

Issue 785173 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ClassicPendingScript outliving after navigation (memory leak)

Project Member Reported by yuzus@chromium.org, Nov 15 2017

Issue description

This memory leak was found with Real-world leak detector (https://docs.google.com/document/d/1wUWa7dWUdvr6dLdYHFfMQdnvgzt7lrrvzYfpAK-_6e0/edit?ts=5976c2d3).

After navigating away from https://binomo.com/, ClassicPendingScript is alive with the state of kWaitingForStreaming.
It seems like ScriptStreamer::StreamingComplete never gets called for a script (https://assets.zendesk.com/embeddable_framework/main.js) which is loaded for this website.
 

Comment 1 by yuzus@chromium.org, Nov 15 2017

Components: Blink>JavaScript
Cc: u...@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>GC
Status: Available (was: Untriaged)

Comment 3 by u...@chromium.org, Nov 17 2017

Owner: marja@chromium.org
Status: Assigned (was: Available)
Marja, if I remember correctly you worked with script streaming in the past.
Any idea if this bug with ScriptStreamer::StreamingComplete is in V8 or in webpage JS code?





Comment 4 by u...@chromium.org, Nov 17 2017

Cc: marja@chromium.org
Owner: vogelheim@chromium.org
Daniel: Marja mentioned offline that you are working on a similar case.

Could you please take a look?
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 11 2017

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

commit b7712bbb47becf743b6af7818698dc4a34bff91f
Author: Yuzu Saijo <yuzus@chromium.org>
Date: Mon Dec 11 09:02:06 2017

Change WrapPersistent to WrapWeakPersistent to fix memory leak

This CL intends to fix a memory leak that is caused by a reference cycle (ScriptRunner -> ScriptRunner).
Memory leak happens with ClassicPendingScript over page navigation with https://binomo.com, the case which a script is loaded but never finishes streaming (i.e. ScriptStreamer::StreamingComplete is never called).
This leads to a memory leak because streamer_done_ which has ScriptStreamer in a closure never gets released.

Bug: 785173
Change-Id: I901bdf134dabaa5d32a090b3490e77d5292ffae0
Reviewed-on: https://chromium-review.googlesource.com/758306
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523060}
[modify] https://crrev.com/b7712bbb47becf743b6af7818698dc4a34bff91f/third_party/WebKit/Source/core/dom/ScriptRunner.cpp

Sign in to add a comment