Re:Google Closure: How not to write Javascript
by mustpax on Tuesday November 17, 2009 @11:54AM
(#946729)
With caching I don’t think you can assume any values are sure to never be used again.
Yes, there are some situations where circular references to DOM elements and the like will cause reference count based GC engines to leak memory. But an unbounded cache does not fit that description. It could be poor memory usage but not a memory leak.
Poorly-thought-out caching is an easy way to do that, especially if the cached values themselves have a chain of references to other values.