8 ms·
Please correct me if I am wrong, but shouldn't developers only worry about the issues mentioned in the article on older browsers? (I'm thinking IE6 and earlier)
by cbetz 17y ago
Please correct me if I am wrong, but shouldn't developers only worry about the issues mentioned in the article on older browsers? (I'm thinking IE6 and earlier).
Introducing a leak via circular references would be considered a bug in most modern JS engines, right?
A related question: Can someone recommend a good plugin/extension for monitoring the size of a page's javascript memory usage over time?
- mhansen 17y agoChrome's Web Inspector lets you take heap snapshots at different times. It won't give you a graph of memory usage, but it will let you monitor it at different times
- BudVVeezer 17y agoI think developers should always try to avoid poor programming practices instead of relying on implementation details of the browser.
- natrius 17y agoPoor programming practices? The code that creates circular references is clearer than the example workarounds. Sacrificing clarity to avoid a problem that doesn't occur in supported browsers doesn't make much sense.
- BudVVeezer 17y agoFailing to call "delete" on a pointer you "new"'ed in C++ is also clearer, and just as incorrect. The ECMAScript spec makes no mention of how memory will be managed for the user. Right or wrong in terms of clarity, it's still a poor practice to assume the browser will behave in a particular way that's not covered by the specification (regardless of how sensible that behavior might be!).