Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 669
Vivian River Avatar asked Jun 08 '12 18:06

Vivian River


1 Answers

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.

like image 140
Denys Séguret Avatar answered Oct 12 '22 10:10

Denys Séguret