-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows created through kranium are not garbage collected #3
Comments
Thanks for the investigation! |
+1 for garbage collector. I started using xcode Instruments and saw, that most of the elements created by Kranium are not garbage collected and produce memory leaks. |
Yes, this is a major problem, and I have yet to come up with a viable solution. I don't see how this could possibly be solved elegantly in the JS context. There is some research being done on WeakMaps (https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/WeakMap), which could help, but they're very very far from done yet. I'm currently working on Kranium 0.2, and what I think I'll do there is to only make elements queryable if the developer explicitly says so, through setting the |
Thats a great Idea. Querying is "just" a nice-to-have feature for me. I love the kss-styling most. Without the need to rebuild the entire project like with standard-jss... When do you think to finish the new version? I'm getting troubles with memory leaks and dont want to drop kranium. |
Good! Then I'll proceed making querying opt-in :-) For the status of Kranium 0.2 and its Ti SDK 1.8 support, please see #12 |
Please if anyone have solution for memory leaks in version 1.4 place it here. This is very important for us also. |
This is because they are retained in global cache for
K.elsByName
,K.elsById
, andK.elsByClassName
(and potentially elsewhere). For views, callingremove()
will remove them from these caches, but there is currently no way to do this for windows.I would think that calling
close()
on a window should remove it, and its subviews from the cache, so that they can be garbage collected.close()
should probably look something like this (not thoroughly tested)On a related note, it is unclear how to call
close()
from inside a KUI component, exapp.js
foo.js
The text was updated successfully, but these errors were encountered: