Does Your JavaScript Leak? Introducing Google Leak Finder
Does Your JavaScript Leak? Introducing Google Leak Finder
Written by Ian Elliot   
Friday, 10 August 2012

Google has just released a memory leak finder for JavaScript. It is open source and ready to work for you.

The introduction to the Leak Finder page on Google Code says:

"In JavaScript you cannot have "memory leaks" in the traditional sense, but you can have objects which are unintentionally kept alive and which in turn keep alive other objects, e.g., large parts of DOM."

Which will ring a little hollow to anyone who remembers the way that closures would leak memory like seives in the early days. But apart from such JavaScript engine failures, the statement is correct in theory. In a garbage-collected language you can't have memory leaks because you mismanaged the memory pool.; there is no memory pool and objects are garbage-collected as soon are there are no references to them.

 

googleleaksmall

Click for larger image - opens in new window

Of course, you can forget to dereference objects that you are using, and this isn't really a memory leak just an inefficiency. The new tool will help you find such problems, but it comes with a cost. You have to modify your code to make use of goog.Disposable and explicity call dispose() on an object before you free up the reference. It also works with closure by default, but you can apparently use it with other libraries.

It also only works with Chrome and isn't exactly effort-free to install.

What all this says to me is that we are still poorly served in terms of JavaScript tools. Yes, it's nice to have a free open source memory leak finder, even if it does force you to use the disposable pattern. What is less acceptable is that this isn't integrated into an easy-to-use integrated debugger.

There are a lot of JavaScript programmers searching for their ideal IDE, but there are even more who don't even know that things don't have to be like this and so aren't even aware that they are missing an easy-to-use IDE.

 

googleleaktap

More Information

Leak finder

Related Articles

JavaScript The Evil Parts - You Can't Maintain It.

Mozilla Gladius Game Engine Reaches V0.1

Pit - F# to JavaScript Compiler

JavaScript debugging tools move forward

 

blog comments powered by Disqus

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Predix - A Platform for the Industrial Internet Of Things
30/06/2015

Predix, GE's forthcoming platform for the Industrial Internet is a cloud-based platform designed for building and powering industrial-strength apps. As GE prepares to share details about the Pred [ ... ]



Amazon Opens Up Alexa To Developers and Third Parties
25/06/2015

Amazon's Alexa provides a cloud-driven way to add voice technology to services and devices and there's a role, and the potential for seed funding, for both developers and hardware manufacturers.  [ ... ]


More News

Last Updated ( Friday, 10 August 2012 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2015 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.