Javascript MemoryLeak Issues

Javascript Memory Leak Issues

We have been facing memory leak issues while developing html5 apps. It is observed that app is broken after browsing through the pages in the app. The memory usage is increased by time. The memory is not released after use. So we searched for some solution and found some technic which will improve memory usage.

1. Nullify the references after use and delete them
Eg: var name1 = someObject;
after scope,
name1 = null;
delete name1;

2. Remove domElements after use(jquery)
var name2 = $("something");
after scope,
name2.remove();

No comments:

Post a Comment