Post on 16-Jul-2015
2
What We’ll Cover
- Common Javascript leaks - Performance - Introduction to XCode Instruments - How to narrow down leaks in your code - Introduction to DDMS (if time allows)
Project Files: https://github.com/rblalock/codestrong2011_appleak
5
Anti-Patterns
Even setting the window to null will not release the global objects
What about doing something like:
someNameSpace.win = null;
6
Anti-Patterns
If you insist on having objects in some global namespace then do this:
This is still not ideal
7
Local variables referenced inside a global event will cause a memory leak every time
Don’t Do This!
9
Needless Execution
Don’t execute code until you need it
The biggest performance hit will be on Android
No point in processing something that isn’t going to be used yet
Especially bad when done in several included files in app.js
14
Brief Overview Living���Live objects using resources
Transitory Objects that have been collected
Overall The sum of both columns above