New issue
Advanced search Search tips

Issue 810812 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

V8Debugger::ScriptCompiled has 2.9GB of memory allocated

Project Member Reported by alph@chromium.org, Feb 9 2018

Issue description

Repro steps:
1. Run chrome with --sampling-heap-profiler --enable-devtools-experiments on Linux
2. Enable native memory sampling profiler experiment in devtools
3. Open a gmail.com page
4. Open DevTools on it
5. Leave it over night
6. In the morning see a break in DT on potential OOM crash
7. Take native heap snapshot on DT Memory panel. 

The process memory is 6.1GB, JS heap is 2GB, V8Debugger is 2.9GB

It could be that there are indeed that many scripts created by gmail, but even if so can we do better on our side?


 
Screenshot from 2018-02-09 10:12:05.png
84.9 KB View Download
Screenshot from 2018-02-09 10:09:40.png
298 KB View Download
Screenshot from 2018-02-09 10:04:13.png
172 KB View Download
gmail-6gb-heap-20180209T100013.heapprofile
432 KB Download
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 16 2018

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

commit 6db8a9c0792a45275e46c076e1f9aaca31f81223
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Fri Feb 16 20:55:24 2018

[inspector] cleanup old failed to parse anonymous scripts

We already cleanup these scripts on frontend side. It is crucial to
cleanup them on backend side as well, since some web applications use
following logic: get some data from network, add this data to buffer,
try to parse buffer using JSON.parse. On each unsuccessfull JSON.parse
we get another scriptFailedToParse event.

Frontend logic of discarding scripts: https://goo.gl/FDtaWK

Some idea of smarter logic here: track what script ids are reported
using protocol and cleanup only script ids which reported not only as
part of scriptFailedToParse event.

R=alph@chromium.org

Bug:  chromium:810812 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ifd67764c232e4abc7dc6e8e69a651bf9ac0e381b
Reviewed-on: https://chromium-review.googlesource.com/919834
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51337}
[modify] https://crrev.com/6db8a9c0792a45275e46c076e1f9aaca31f81223/src/inspector/v8-debugger-agent-impl.cc
[modify] https://crrev.com/6db8a9c0792a45275e46c076e1f9aaca31f81223/src/inspector/v8-debugger-agent-impl.h
[add] https://crrev.com/6db8a9c0792a45275e46c076e1f9aaca31f81223/test/inspector/debugger/cleanup-old-failed-to-parse-anonymous-scripts-expected.txt
[add] https://crrev.com/6db8a9c0792a45275e46c076e1f9aaca31f81223/test/inspector/debugger/cleanup-old-failed-to-parse-anonymous-scripts.js

Comment 2 by kozy@chromium.org, Feb 16 2018

Status: Fixed (was: Assigned)

Sign in to add a comment