New issue
Advanced search Search tips

Issue 852408 link

Starred by 3 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Memory Leak - Reloading Frames

Reported by tom...@gmail.com, Jun 13 2018

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36

Steps to reproduce the problem:
1. Open Chromium Dev Tools.
2. Open Chromium Task Manager.
3. Reload an iframe without reloading root frame (multiple times if necessary).

Simplified Test Case:

	<!doctype html>

	<iframe src="foo"></iframe>

	<script>

		let i = 0;

		const iframe = document.querySelector('iframe');

		const interval = setInterval(() => {
			if (++ i === 2048) {
				clearInterval(interval);
			} else {
				iframe.src += '';
			}
		}, 32);

	</script>

This will consume ~1GiB of memory over ~1 minute.

In this case it is necessary to load the page many times because it is very small (the invalid url results in loading chromes internal 404 page instead)... Larger pages need far less reloads to observe the effect.

Additionally the iframe must be from the _same_ origin to cause the issue (although opening the above example as a local file emulates this).

What is the expected behavior?
GC should recover memory from previous iframes over time.

What went wrong?
The task manager will show how the page's memory usage grows unbounded, this usage will not be shown in the memory snapshots of dev tools as the leak is not part of the root frame VM or current iframe VM.

This only occurs when Dev Tools are open.

Did this work before? N/A 

Chrome version: 67.0.3396.79  Channel: n/a
OS Version: 4.4.0-128-generic
Flash Version: 

This makes it quite painful to develop with iframes and live-reloading... it's easy for dev tools to consume all of a machines ram in a very short time.
 
Labels: Needs-Triage-M67

Comment 2 by l...@chromium.org, Jun 14 2018

Owner: alph@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report.  I can confirm this bug reproduces only when DevTools is open.  Maybe alph@ would like to take a look?

Comment 3 by alph@chromium.org, Jun 14 2018

Owner: dgozman@chromium.org
Attaching heap profile. Looks like most of the DOM tree objects from released frames are retained by something while DevTools are open.

Dmitry might know why we retain those for removed frames.
Heap-20180614T144514.heapprofile
111 KB Download
Screenshot from 2018-06-14 14-58-16.png
182 KB View Download
Any progress on this one?

Surprised i'm the only one, it hits me almost every day. I've resorted to keeping htop open in fear of dev-tools swapping out all my ram.
Components: -Platform>DevTools Blink>HTML>Frame
Owner: ----
Status: Untriaged (was: Assigned)
Tried this locally. The memory leak is reproducible with and without DevTools, but DevTools makes it larger. Perhaps, the document loaders are leaking for some reason (as seen in attached screenshot).

Sign in to add a comment