Chrome DevTools Profiler Chrome DevTools Profiler google-chrome google-chrome

Chrome DevTools Profiler


There are number of different v8 internal things in the heap that cannot be accessed from javascript.

As example (script line ends) is an array that have line end offsets for a script.v8 needs it for setting up a breakpoint.

Each time when you create an object, v8 does many things and allocates memory for them.See Lars Bak video about v8. http://www.youtube.com/watch?v=hWhMKalEicY

If you are interesting in the topic there are number of slides and presentations about v8 internals.

The simplest way to find a leak is to use "Record Heap Allocations" profile.It shows you a "realtime" chart with allocations.

you need to start the recording, repeat your scenario a few times and if the code has a leak then you will see the same number of blue vertical bars on the chart. So you should stop the recording and select the blue bar somewhere in the middle and see what objects it has.

the first blue bar is not interesting because it could have allocations that were made only once.

the last one also is not interesting because it might have allocations that will be released at the next repeat of your scenario.

So the best candidate is a bar in the middle. http://www.youtube.com/watch?v=x9Jlu_h_Lyw

The most interesting items are the objects that were created by your script.