Let V8 know about the external memory owned by large StaticNodeList

If a script allocates many large but short-lived StaticNodeList objects,
for instance by using querySelectorAll() in an inefficient way, memory
usage will balloon since V8's garbage collector won't realize that much
memory owned by it is being allocated, and thus doesn't run its GC.

Reporting external allocated memory to V8 is unnecessary overhead for
small objects, so only do it for objects larger than a limit.

BUG=342752

Review URL: https://codereview.chromium.org/154263007

git-svn-id: svn://svn.chromium.org/blink/trunk@166937 bbb929c8-8fbe-4397-9dbb-9b2b20218538
2 files changed
tree: 3c18c745ba33bb7c80269e8f1a933ede29bc6c52
  1. third_party/