Hi, On 12/22/2013 05:57 AM, Prateek Jadhwani wrote:
From the looks of the code, it seems that the js files LazyLoads the code of the modules it needs. My question is does it get rid of the js files that were LazyLoaded after its work is done, or does it stay in the memory. Coz if it just keeps on adding every file, then it might cause some serious performance problems. And I have no idea if the garbage collection of the Gecko engine releases just the object or the files associated as well.
No the LazyLoader does not unload anything, it adds script tag to existing file such as these files could be loaded by the JS engine. So far, JavaScript semantics is not helping.
Except Haida, there is no good approach to this issue, and the memory consumed by JavaScript will at least be the one used by the sources.
Haida's solution is to split applications into multiple pages/frame. Note that even if you still use the LazyLoader, you will reduce the cap of memory that is induced by each page, by isolating loaded sources into specific panels only.
Haida's solution has a side effect which is that even if each view might consume less memory per window/panel/frame the overall might be larger if you have multiple views, as you are loading multiple times common resources, but this is acceptable within the condition that you are able to restore a view to its previous state.
-- Nicolas B. Pierron _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
