How to check javascript jamming consumption

I need to improve the performance of a script executed in Javascript, and I can check the RAM script consumption.

e.g. like PHP get_memory_get_peak() function

+6
source share
4 answers

In Chrome, if you use the --enable-memory-info flag, you can get data from:

 console.memory; 

which contains:

 jsHeapSizeLimit totalJSHeapSize usedJSHeapSize 

This data can also be extracted from a snapshot of the memory heap by pressing F12 , but this is not software.

+11
source

Chrome developer tools include a heap profiler: http://code.google.com/chrome/devtools/docs/heap-profiling.html

+3
source

You cannot read memory data using JavaScript code. The method of viewing memory consumption is a process check.

Chrome has a built-in statistics screen that can be called up using Shift + Esc . This screen displays various information about each tab, including memory consumption.

+2
source

You can format the PHP code using CSS and JS, but more on that. Use the PHP function, and HTML cannot do this, it's just a markup language .

  <?php print(get_memory_get_peak()); ?> 

Try using Task Manager , go to processes and check usage statistics!

-5
source

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


All Articles