Is there a way to find out how much memory is being used by a web page, or by my jquery application?
Here's my situation:
I'm building a data heavy webapp using a jquery frontend and a restful backend that serves data in JSON. The page is loaded once, and then everything happens via ajax.
The UI provides users with a way to create multiple tabs within the UI, and each tab can contain lots and lots of data. I'm considering limiting the number of tabs they can create, but was thinking it would be nice to only limit them once memory usage has gone above a certain threshold.
Based on the answers, I'd like to make some clarfications:
- I'm looking for a runtime solution (not just developer tools), so that my application can determine actions based on memory usage in a user's browser.
- 计算DOM元素或文档大小可能是一个很好的估计,但它可能非常不准确,因为它不包括事件绑定、数据()、插件和其他内存中的数据 struct .