I'm new to HTML5 application. And I'm making in-house software. This means I can force users to use only most recent version of firefox/webkit.
I saw many documents concerning about JS memory leaks in these point:
As I think, it's just a problem of only (old version of) IE. But I cannot sure about this. So I'm asking do I have to address this issue in my situation. If I should, what's the solution, and what's the additional issues I have to care?
Use a javascript library and you will be fine. jQuery makes it so you can have circular references, closures that refer back to jQuery objects, and event handlers that you never clean up. jQuery will automatically pick up all the pieces on unload if necessary and will also keep memory from leaking in any browser it supports.
If you are developing a JS-based application in which the page never (or rarely) refreshes, then you might have to worry about leaks, but they are easily overcommable by making plugins which have a deconstructors that destroys all member objects and dom elements. The jQuery .remove function removes the dom elements, the handlers, and anything else attatched to that element.
So just use a JS library and if you have to develop a lot of JS code, be careful and use a design pattern that is easy to clean up (like jQuery's plugin design pattern).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With