pchu
pchu

Reputation: 181

Why does a Node.js heapdump shows compiled code?

Hi first time at investigating memory leak in a Node.js application. By reading thru a heapdump snapshot in Chrome Profiler, I see that there is an entry for (compiled code), see attached. I thought Javascript is not compiled, unlike Java. Can anyone shed some lights?

enter image description here

Further, unlike JProfiler and with the way the code was written (without a formal constructor), it is very hard to find the leak, and so far the info the snapshot provides is not quite useful, I have searched for sometime and so far not too much useful info on reading these snapshots, any suggestions?

Thanks!

Upvotes: 4

Views: 2003

Answers (2)

Vyacheslav Egorov
Vyacheslav Egorov

Reputation: 10492

(compiled code) indeed refers to the code generated by V8's JIT compiler. All JavaScript VMs employed by browsers today are using tiered adaptive JIT compilation - it wouldn't be possible to achieve good performance otherwise. In fact V8 never had an interpreter at all.

Upvotes: 5

SLaks
SLaks

Reputation: 887453

That refers to host objects that are implemented in C++, such as the DOM, or the JS built-in functions.

Upvotes: -2

Related Questions