Over a million developers have joined DZone.

Node.js Performance Garbage Collection

DZone's Guide to

Node.js Performance Garbage Collection

· Performance Zone
Free Resource

Discover 50 of the latest mobile performance statistics with the Ultimate Guide to Digital Experience Monitoring, brought to you in partnership with Catchpoint.

In another installation of useful node.js/V8 Javascript performance finds, the folks over at the StrongLoop blog  wrote about garbage collection in node.js this week. V8, with built-in garbage collection, has it's benefits and shortcomings:

...you also give up control on memory management, which could be a problem particularly for mobile applications aiming for the optimization of device resources. In particular for JavaScript, the ECMAScript specification doesn’t expose any interface to the garbage collector blocking visibility and forced GC.

Performance wise, it is a wash. In C, allocating (malloc) and freeing objects can be costly, since heap bookkeeping tends to be more complicated. With managed memory, allocation usually means just incrementing a pointer, but  you pay for it eventually when you run out of memory and the garbage collector kicks in.  The fact is that V8  uses garbage collection for better or worse.

They go on to outline how V8 divides the heap into manageable chunks and the processes through which garbage collection is enacted. Check out the post.

Is your APM strategy broken? This ebook explores the latest in Gartner research to help you learn how to close the end-user experience gap in APM, brought to you in partnership with Catchpoint.


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}