New issue
Advanced search Search tips

Issue 922925 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Memory leak(s) when running web page, which in loop loads and unloads NaCl module

Reported by abujal...@gmail.com, Jan 17 (5 days ago)

Issue description

UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce the problem:
1. Launch Chrome with enabled Native Client
2. Go to web page from attached TC (hello_world_cpp_widget.zip)
3. Observe memory usage when tests runs for long time (at least an hour).

What is the expected behavior?
- Browser process memory doesn't increase
- Renderer process memory usage oscillates, limit superior and limit inferior of the oscillation remains constant

What went wrong?
- Browser process memory increases constantly
- Renderer process memory usage oscillates, limit superior and limit inferior of the oscillation increases during time

See attached plots showing RSS memory usage [KiB] vs time [s]:
- 20190104.01.chrome-official.71.0.3578.98.png
- chromium.ebfd63fd9e.png

Did this work before? N/A 

Chrome version: 73.0.3666.0 (Developer Build) (64-bit)  Channel: stable
OS Version: Ubuntu 16.04.5 LTS
Flash Version: 

I've investigated issuse and found two problems:
1. HTMLPlugin element is added to LocalFrameView in LoadPlugin method, however there is no way to remove plugin from LocalFrameView.
2. In PepperPluginInstanceImpl ctor FrameHostMsg_DidCreateInProcessInstance message is sent to browser process, however message FrameHostMsg_DidDeleteInProcessInstance isn't sent from dtor. This is because PepperPluginInstanceImpl is created for unproxied module and later reinitialized as proxied one, which causes that PepperBrowserConnection::DidCreateInProcessInstance method is called in PepperPluginInstanceImpl ctor, however PepperBrowserConnection::DidDeleteInProcessInstance isn't called in PepperPluginInstanceImpl dtor.

See attached patch: patch_based_on_ebfd63fd9e.diff

These two finding reduces memory usage when running tests for around 2hrs (see plot: chromium-ebfd63f-vs-patched.png) however when running tests for a 19hrs (around 70000 seconds) shows that memory increases for both Browser and Renderer processes (see plot: chromium-patched_19hrs.png).

Any hints how to debug problem further? I've try to use memlog however gathering trace for such long time wasn't feasible and I couldn't find anything in heap dumps.
 
hello_world_cpp_widget.zip
2.3 MB Download
20190104.01.chrome-official.71.0.3578.98.png
190 KB View Download
chromium.ebfd63fd9e.png
154 KB View Download
patch_based_on_ebfd63fd9e.diff
5.7 KB Download
chromium-ebfd63f-vs-patched.png
136 KB View Download
chromium-patched_19hrs.png
154 KB View Download

Comment 1 by dtapu...@chromium.org, Jan 17 (5 days ago)

Cc: tkent@chromium.org dtapu...@chromium.org joelhockey@chromium.org
Components: Blink>DOM
Status: Untriaged (was: Unconfirmed)
I think https://chromium.googlesource.com/chromium/src/+/81e8236cd00c7fd443cb281ce85599605671b117

caused the ever growing plugins_ object inside the LocalFrameView. joelhockey@ do you agree?

Comment 2 by fergal@chromium.org, Jan 18 (5 days ago)

Components: -Blink>DOM Blink>Internals>Frames
Remove Blink > DOM component as it doesn't seem relevant. Feel free to add it back if I'm mistaken.

Sign in to add a comment