3

I'm wondering if it's possible to get the current memory usage of a specific page? I am working on a little DOM-render experiment where I'm rendering 100 000+ DOM-elements and want to be able to show the memory usage of the application before rendering the DOM as well as after completion to se the difference. Any JS-library or something that will help me do that? Preferably with Chrome, FF and IE support.

The application is constructed with HTML and JS

Thanks

Erik Åstrand
  • 369
  • 2
  • 5
  • 14
  • Internet explorer: F12 Memory profiler (from on version IE11) – Icepickle Mar 08 '16 at 15:24
  • Does this answer your question? [jQuery or javascript to find memory usage of page](https://stackoverflow.com/questions/2530228/jquery-or-javascript-to-find-memory-usage-of-page) – Heretic Monkey Oct 20 '20 at 01:22

1 Answers1

-1

You may wish to look at this answer from galambalazs

Unfortunately, right now this is still a Chrome only feature (a non-standard extension of window.performance).

window.performance.memory

Browser support: Chrome 6+

You could also look at this:

The Performance.now()

A method returns a DOMHighResTimeStamp, measured in milliseconds, accurate to one thousandth of a millisecond.

This is more widely supported

I hope this helps

Community
  • 1
  • 1
Chris Rogers
  • 1,525
  • 2
  • 20
  • 40
  • Hello, thanks for the reply. As far as I know from read about window.performance.memory it doesn't add DOM-nodes into the equation? When I try to run it before and after rendering DOM i get the same memory usage. – Erik Åstrand Mar 08 '16 at 16:36
  • You could use [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded). See [my example here](https://jsfiddle.net/5squvgLv/1/). I hope this helps. – Chris Rogers Mar 09 '16 at 11:39