Preview of what is in memory (javascript)

I am creating an application in javascript and I would like to use console.log to preview everything that is in memory at runtime. I know that I can check each variable selectively, but: is there a way to see everything?

Thankyou.

+4
source share
2 answers

Install Firebug in Firefox. From there, you can press the DOM and see all the declared javascript variables. There is also an arrow that allows you to specify the source of the variables that you would like to see, such as "only user properties", etc. Etc. Hope this helps you. (You can also console.log the window object as it contains everything)

.... EDIT .... After Josh's comments, I decided to take a look if any browser provided the opportunity to really see all the memory at the moment, and the Chrome developer tools do exactly what you want. Just run the developer tool - click on โ€œProfilesโ€, then click on the โ€œeyeโ€ icon in the lower left corner and you will get a whole collection of all the things that are currently in memory (including items in the closure). Hope this helps, your question helped me :)

+4
source

Google Chrome has developer tools where you can go to the Profiles tab to get a heap snapshot. Chromium nightly builds seem to have a more detailed preview of memory usage than the current stable version of Google Chrome.

+1
source

Source: https://habr.com/ru/post/1385360/


All Articles