Firefox Memory for AJAX Desktop Apps demystified?
Jim Plush have an interesting article on management of Firefox memory for AJAX desktop apps. In his job, Jim have to write desktop-like applications in javascript/php on Firefox that might not be restarted for weeks, the problem is dealing with memory consuming for Firefox and after experiments he find out that the best way will be to make his functions methods of Objects : "This will allow you to have simple destructor methods that only need to worry about deleting one object after leaving a page instead of having to worry about all those functions that are taking up memory, or storing data in un-needed global variables".
If you do find yourself with large data structures, try and break them up into small objects that are essentially required. Remember, Firefox will grow to the largest amount you request. So request small things and your memory "should" stay in a reasonable place. This may seem like a small example but when you start getting into pages that require 5,000 lines of JS and huge arrays of data it starts to become a big deal to clean up after yourself. Especially for apps like mine that run in closed environments.


Subscribe to AJAX Magazine's feed