Could you tell me how to use Heap Snapshot Profile to detect leak?

7 views
Skip to first unread message

Liu Xiao

unread,
Sep 3, 2014, 2:12:50 AM9/3/14
to chromedev...@googlegroups.com
Hello everyone:

Now I want to detect leak on JS heap by using Comparison View in Heap Snapshot Profile.

First I take a snapshot as a baseline.

Then I call a function in Javascript like this:

////////////////////////////////////////////////////////////////////////////////////
function create_local_array()
{
  var result = new Array(50000);
  
  for (var i = 0, l = result.length; i < l; ++i)
      result[i] = i;
}
////////////////////////////////////////////////////////////////////////////////////

At last I take the second snapshot for comparison.

But there are lots of objects new generated, so that I can't confirm if this function is good or not (no memory leak).
I think the function is good enough.



Why there are lots of objects generated?
Could you tell me how to use it to detect?
Reply all
Reply to author
Forward
0 new messages