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+

Google Drive & Permissions I'm trying out Google Plus for some lazy web-publishing and seeing con…

Google Drive & Permissions

I'm trying out Google Plus for some lazy web-publishing and seeing continued file-permission strangeness.  Here's an example in case others are experiencing similar and it's reproducible…

Before I begin, the remote machine looks like this:

rjb@buck-16~/Google Drive/xyz/words $ ls -la
total 48
drwxrwxrwx   7 rjb  staff   238  8 Aug 15:45 .
drwxrwxrwx+ 22 rjb  staff   748  8 Aug 15:45 ..
-rwxrwxrwx   1 rjb  staff   341  7 Jun 10:58 404.html
-rwxr-xr-x   1 rjb  staff   321  8 Aug 15:34 defaults.php
-rwxrwxrwx   1 rjb  staff  6462  8 Aug 15:42 index.html
-rwxrwxrwx   1 rjb  staff  3031  6 Jun 22:25 js.html
-rwxrwxrwx   1 rjb  staff   115  6 Jun 20:21 menu.html

I then locally edit `js.html`.  Note the timestamp and permissions:

rjb-mbp:words rjb$ ls -la
total 48
drwxr-xr-x   7 rjb  staff   238  8 Aug 15:41 .
drwxr-xr-x  22 rjb  staff   748  8 Aug 15:42 ..
-rwxr-xr-x   1 rjb  staff   341  7 Jun 10:58 404.html
-rwxr-xr-x   1 rjb  staff   321  8 Aug 15:34 defaults.php
-rwxr-xr-x   1 rjb  staff  6462  8 Aug 15:42 index.html
-rwxr-xr-x   1 rjb  staff  3119  8 Aug 15:50 js.html
-rwxr-xr-x   1 rjb  staff   115  6 Jun 20:21 menu.html

Shortly afterwards on the remote machine it appears thus – note how the modification time is updated (and indeed the file is updated) but neither the original permission, nor those on the machine where the file was edited, are used):

rjb@buck-16~/Google Drive/xyz/words $ ls -la
total 48
drwxrwxrwx   7 rjb  staff   238  8 Aug 15:54 .
drwxrwxrwx+ 22 rjb  staff   748  8 Aug 15:45 ..
-rwxrwxrwx   1 rjb  staff   341  7 Jun 10:58 404.html
-rwxr-xr-x   1 rjb  staff   321  8 Aug 15:34 defaults.php
-rwxrwxrwx   1 rjb  staff  6462  8 Aug 15:42 index.html
-rw——-   1 rjb  staff  3119  8 Aug 15:50 js.html
-rwxrwxrwx   1 rjb  staff   115  6 Jun 20:21 menu.html

This is syncing between a two OS X Mountain Lion machines.
#googledrive   #apple   #osx

_P.S. I'm using 777 to illustrate the point, that's not normal_ :-)

Comment on Google+