There are several different v8 internal things on the heap that cannot be accessed from javascript.
As an example (<end w370>), there is an array that has end-of-line offsets for the script. v8 needs it to set a breakpoint.
Each time you create an object, v8 does a lot of things and allocates memory for them. Watch the Lars Bak video about v8. http://www.youtube.com/watch?v=hWhMKalEicY
If you are interested in this topic, there are a number of slides and presentations about the internal functions of v8.
The easiest way to find a leak is to use the Heap Record profile. It shows you a “real time” chart with distributions.
you need to start recording, repeat your script several times, and if the code has a leak, you will see the same number of blue vertical bars on the chart. Therefore, you should stop 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 can have selections that were made only once.
the latter is also not interesting, since it may have selections that will be released the next time you repeat your script.
Thus, the best candidate is the strip in the middle. http://www.youtube.com/watch?v=x9Jlu_h_Lyw
The most interesting are the objects created by your script.
source share