Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing undo feature: how to measure memory consumption of JavaScript array?

We need to implement undo functionality for a web editor and want to test how deep the undo history could reasonably go.

The undo data model is a JavaScript array containing 1+ jQuery objects, each of which could contain multiple Base64 images.

How can you measure memory usage of JavaScript objects? Is it possible to monitor memory usage from Chrome?

like image 484
Crashalot Avatar asked Mar 26 '19 09:03

Crashalot


1 Answers

Chrome have a great tool for that. It's based on RAIL model and allows you to quickly detect leaks and even bloats. Just go to chrome's Task Manager (shift + esc) and enable Javascript memory. This tool saved my life, good luck!

like image 83
Dupocas Avatar answered Oct 10 '22 20:10

Dupocas