Wednesday, April 23, 2014
What do you mean by Memory leaks? And how to fix it.
Memory leaks
occur when your app allocates memory but doesn't release it. Leaks occur when
unintended or overlooked references to objects remain in scope. When this happens, JavaScript can't garbage collect the objects and
Titanium can't destroy the native proxies. Because the causes of leaks vary
so widely, at best we'll be able to give you some strategies to attempt in
order to solve the problems. There are no "cookie cutter" solutions
for stopping memory leaks.
The
efficient tips for memory management in Titanium:
1)
Include minimum files in app.js
2)
Release objects from memory to avoid crashes and app
slowness
3)
Assign objects to null instead of hiding them
4)
Remove app level events after usage
5)
Create variable using var
6)
Assign global scope to null
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment