Search code examples
javascriptnode.jsprofilingphpstormwebstorm

Why would a node.js profile be multiple GB in size? way to big for webstorm to handle


So, I'm trying to profile an existing large-ish node.js webapp.
It seems to run OK, when running normally, I added a debug launch configuration.

My first attempt, I left it running, attempting to load a very complex page - came back to find a 4GB profile log had filled the remaining space on the small partition it (and my system) is on causing all sorts of problems.

Did a quick test, running the server for only a few seconds, got a ~15MB profile of it loading some modules - but it works.

A second attempt - watching much closer, I started loading a simpler page as soon as the server was accepting connections (watching the profile log grow at ~3mb/s) - by the time the page had loaded, I have a 600MB log, stop the server to see the results.
After waiting for quite a long time, phpstorm complains it does not have enough memory - limited to 750MB.
I've increased it to 1500MB - but thought I should ask for some wisdom here before another test, as this profiler really does not seem practical!

Am I just expecting too much for this profiler to give me info on a complex app(and I should use a different profiler)?
Does this indicate some kind of problem with the app?
Perhaps I am doing something wrong?

All answers welcome!

Edit: the command phpstorm runs is /usr/bin/node --prof --logfile=v8-23-11-15_00-37-35-0.log --log-timer-events bin/www


Solution

  • OK, removing --log-timer-events makes the log a reasonable size, and the server runs at a decent speed! There is less info - but it still seems to contain much of what I am hoping/expecting to see.

    Not marking this answer as accepted, as I feel I am still floundering in the dark a little more than I'd like.