News for hackers. Stuff that matters.
Re:Google Closure: How not to write JavaScript by ivank on Monday December 13, 2010 @01:32AM (#1999598)
> A memory leak is the inability of a program to free memory it has allocated.

Unexpected memoization/caching also counts as a memory leak. There are (unfortunately) a few places in Closure Library where unexpected memoization might cause a memory leak.

> Since js is garbage collected causing a memory leak involves creating a circular reference fooling the garbage collector into thinking that an object is still in use.

Browser environments are expected to handle circular references. They don't fool garbage collectors, except in old versions of IE when a circular reference crosses the JScript/DOM boundary.

Re:Google Closure: How not to write JavaScript by kwamenum86 on Monday December 13, 2010 @11:11PM (#2003090)
Are you saying that the memory allocated by the memoizer is not recoverable e.g. won't be released until the browser is killed? If not then it is not a memory leak.
Re:Google Closure: How not to write JavaScript by ivank on Tuesday December 14, 2010 @04:29AM (#2003657)
It's potentially recoverable, but stuck in some "private" object your JavaScript application will never bother to look at. It's still a memory leak.