KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a question regarding garbage-collection in google chrome (Version 20.0.1132.47, Ubuntu 11.04 64bit). While comparing heap-dumps and checking for memory-leaks, I discovered some instances, that are never cleaned up. Normally this behaviour can be tracked down to a programmer-error, but in this case I'm rather clueless.. Take a look at the following screenshot The instance 'child @610739' is referenced only by 'bound_this' instances that belong to functions of the child-instance itself. So to my understanding, the child-instance should be garbage-collected, as the only other reference keeping hold of it is the child-instance itself (through the 'bound_this' functions). I'm using underscore.js' 'bindAll' utility function ( underscore.js#bindAll ) that maps to the 'native_bind' function of chrome ( ECMA Script wiki on bound_this ) Am I missing something obvious here and if so, could someone explain what's keeping these instances alive? UPDATE: In the meanwhile I tested the same application in chrominium (18.0.1025.168 (Developer Build 134367 Linux) Ubuntu 11.10) which does not show these dangling instances.. UPDATE 2: Following Esailijas hint to provide a jsfiddle snippet, I created one ( http://jsfiddle.net/8gSTR/1/ ) that mimics what I'm basically doing. Running this fiddle unfortunately does not show the misbehaviour I'm experiencing in my application. A heap-dump taken while 'a'-instances are still referenced looks kind of similar though despite of the reference from the window.o array which keeps the instances alive: <img src="https://i.sstatic.net
Tags (comma-separated)
Save Edits
Cancel