Tag Archives: javascript

Reshared post from Addy Osmani

Detect memory leaks in #javascript .

Addy Osmani originally shared this post:

Leak Finder: Memory Leak Detection For JavaScript

If you regularly work on JavaScript web apps, you'll know that we're unlikely to run into memory leaks in the traditional sense, but it is possible to have objects that are unintentionally kept alive and in turn keep others alive (like big parts of the DOM). 

To help discover these leaks, two of my fellow Googlers (+Marja Hölttä and +Jochen Eisinger) have developed a tool that works with the Chrome Developer Tools (specifically, the remote inspection protocol) and retrieves heap snapshots and detects what objects are causing leaks. 

There's more information (and a whole post on how to use the tool) over at http://google-opensource.blogspot.de/2012/08/leak-finder-new-tool-for-javascript.html and I encourage you to check it out. The project page for the leak finder can be found at http://code.google.com/p/leak-finder-for-javascript/.

Some more info: In case you're wondering why a tool like this isn't already integrated with our Developer Tools, the reason is two fold. It was originally developed to help us catch some specific memory scenarios in the Closure Library and it makes more sense as an external tool (or maybe even an extension if we get a heap profiling extension API in place).

Leak Finder: a new tool for JavaScript – Google Open Source Blog

News about Google"s Open Source projects and programs

Comment on Google+

Code Tutorial Blueprint

I just watched a nice presentation by Yahoo evangelist Christian Heilmann who opened the show at FF09 yesterday. Whilst there’s a lot of good ideas throughout regarding the maintainability of JavaScript code, one nugget stood out about code tutorials. Christian Suggests a four pronged presentation strategy when writing tutorials for designers – it is equally valid when presenting concepts to fresh geeks:

  1. Say what it does.
  2. Show a working example.
  3. Include the full code of the example.
  4. Explain the example using code chunks interspersed with descriptive paragraphs.

A simple & sensible blueprint!