Monday, 4 February 2019

Why is the heap snapshot filled with strings containing old versions of source code?

Also asked on StackOverflow, will copy answers in either place to the other.While investigating differing memory usage of the same Node.js service in different environments, I did a heap snapshot and found that almost 90% of the 330MB heap was strings (total ~900,000 strings) and that almost all of these strings corresponded to the source code of previous versions of the service. This source code is removed from the server when newer versions of the service are deployed.It's perhaps relevant that we continuously deploy using the Capistrano directory structure with a current symlink to the latest version of the app and we only keep the latest three releases of the service on our hosts.-- /var/www/node-js-service |-- current -> /var/www/my-app.com/releases/20100509150741 |-- releases | |-- 20100509150741 | |-- 20100509145325 Why are these old source code files ending up as strings in the heap of our processes and how do we stop it from occurring?​Processing img 977sxzkhsoe21...Processing img jgfr2rnhsoe21...

Submitted February 05, 2019 at 05:42AM by mwakerman

No comments:

Post a Comment