New issue
Advanced search Search tips

Issue 696748 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

extensions console object leaks v8::FunctionTemplate

Project Member Reported by jbroman@chromium.org, Feb 27 2017

Issue description

Templates created with v8::FunctionTemplate::New live forever. Unfortunately, the extensions "console" object makes four of them each time a console is made (which is itself once each time an extension bindings "module" is loaded).

It can be rewritten fairly easily to avoid this leak, and be more efficient.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 28 2017

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

commit b1ad11a47382c78676e8bc71a6201d47309a6b23
Author: jbroman <jbroman@chromium.org>
Date: Mon Feb 27 23:59:24 2017

Rewrite extensions console to not leak function templates.

With this CL, an ObjectTemplate is properly cached in the PerIsolateData, and
the templates for each function are only constructed once. For simplicity, the
level is stored in the function data (rather than a function), which removes
the need to have those functions out-of-line and should reduce both code and
V8 heap size (since small integers don't need a heap allocation).

BUG= 696748 

Review-Url: https://codereview.chromium.org/2718133003
Cr-Commit-Position: refs/heads/master@{#453399}

[modify] https://crrev.com/b1ad11a47382c78676e8bc71a6201d47309a6b23/extensions/renderer/console.cc
[modify] https://crrev.com/b1ad11a47382c78676e8bc71a6201d47309a6b23/extensions/renderer/console.h
[modify] https://crrev.com/b1ad11a47382c78676e8bc71a6201d47309a6b23/extensions/renderer/module_system.cc
[modify] https://crrev.com/b1ad11a47382c78676e8bc71a6201d47309a6b23/extensions/renderer/object_backed_native_handler.cc

Status: Fixed (was: Started)

Sign in to add a comment