I have a single web page application that is all JavaScript. I noticed the JavaScript heap size goes up on each AJAX call that returns a new view. Is there something I should be doing to clean up the older views?
Open the Start menu, search for Advanced System Settings, and select the Best match. In the Variable name field enter NODE_OPTIONS. In the Variable value field enter --max-old-space-size=4096. This value will allocate 4GB of virtual memory to Node.
This generally occurs on larger projects where the default amount of memory allocated by Node (1.5gb) is insufficient to complete the command successfully.
usedJsHeapSize is the total amount of memory being used by JS objects including V8 internal objects, totalJsHeapSize is current size of the JS heap including free space not occupied by any JS objects. This means that usedJsHeapSize can not be greater than totalJsHeapSize.
I would recommend you to take a look at the following resources. You can see how to inspect the browser timeline in order to detect leaking references and performance problems.
The first one is from a Chrome developer talking this year at the Google IO:
http://www.youtube.com/watch?v=3pxf3Ju2row
The second one is from Paul Irish talking at the breaking point episode 2:
http://www.youtube.com/watch?v=PPXeWjWp-8Y
I'm sure you will find a lot of clues!! Anyway ... if you share a test case of your code at jsfiddle.net, we can take a look :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With