Measuring JavaScript Heap
To have access to the JavaScript runtime heap open Chrome with the following flag:
open /Applications/Google\ Chrome.app/ --args -enable-memory-info
After doing so, you have access to the JavaScript heap:
// currently used heap
window.performance.memory.usedJSHeapSize;
// total heap
window.performance.memory.totalJSHeapSize;
Found this very interesting to play around with. More detailed information can be found here: http://buildnewgames.com/garbage-collector-friendly-code/
Written by Jonathan Krause
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Performance
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#