Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 868
pchu Avatar asked Oct 20 '25 18:10

pchu


1 Answers

(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.

like image 151
Vyacheslav Egorov Avatar answered Oct 22 '25 08:10

Vyacheslav Egorov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!