Determine memory usage of cached DOM elements in JavaScript?

Suppose that I write some JavaScript code that displays the first ten records from a database as table row elements. When the user clicks to load more rows, the table row elements are removed from the page, but are saved in Javascript.

Now, suppose that I have a similar page that displays 100 rows at a time and there are thousands of rows that the user might page thru.

How can I know how much memory is being used when these elements are cached in Javascript?


Use Chrome's memory profiler : https://developers.google.com/chrome-developer-tools/docs/heap-profiling

It has all the functions you expect for this kind of analysis.

链接地址: http://www.djcxy.com/p/10852.html

上一篇: 天真实现Objective中的装饰器模式

下一篇: 确定JavaScript中缓存的DOM元素的内存使用情况?