Webstorm No V8 Heap snapshot file created

I am running Webstorm 2017.3 on OSX, Ive installed v8-profiler and enabled v8 heap snapshots in the config. I run my nodejs project and try to Capture a Memory Snapshot - I tried this both with the Tools>menu item AND the toolbar button.

It creates a zip file that contains an .hprof file - looks like its for the IDE itself and not my project.

Please help!

 

Edit: running Node v6.9.1 npm 3.10.0 osx 10.12.6

0
7 comments

Looks like you have taken Webstorm memory snapshot, not your app one:) Please use Take heap snapshot button in Run tool window toolbarws v8 profiling take snapshot to take a snapshot - see https://www.jetbrains.com/help/webstorm/2018.1/v8-cpu-and-memory-profiling.html

0
Avatar
Permanently deleted user

Like I said in my first message, I thought I did try the toolbar, or else I cant figure out how to make it appear.

Above is what I have been clicking. Is this it?

0

No; it's for capturing Webstorm snapshots (same as Tools | Capture memory snapshots); you should have been using Run tool window toolbar button, not the one from the main toolbar. and, of course, you should run your configuration first

0
Avatar
Permanently deleted user

Yes I've been running my configuration first but I see no such button anywhere, nor is it in the Tools menu.

How do I find the proper button?

Also, I had alot of trouble installing the npm v8-profiler on my machine:

From console I ran

sudo npm install -g v8-profiler

Results:

> v8-profiler@5.7.0 preinstall /usr/local/lib/node_modules/v8-profiler

> node -e 'process.exit(0)'

 

> v8-profiler@5.7.0 install /usr/local/lib/node_modules/v8-profiler

> node-pre-gyp install --fallback-to-build

 

node-pre-gyp ERR! Tried to download(undefined): https://node-inspector.s3.amazonaws.com/profiler/v5.7.0/node-v57-darwin-x64.tar.gz

node-pre-gyp ERR! Pre-built binaries not found for v8-profiler@5.7.0 and node@8.7.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)

node-pre-gyp ERR! Tried to download(404): https://node-inspector.s3.amazonaws.com/profiler/v5.7.0/node-v57-darwin-x64.tar.gz

node-pre-gyp ERR! Pre-built binaries not found for v8-profiler@5.7.0 and node@8.7.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)

gyp ERR! configure error

gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/v8-profiler/build'

gyp ERR! System Darwin 16.7.0

gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/v8-profiler/build/profiler/v5.7.0/node-v57-darwin-x64/profiler.node" "--module_name=profiler" "--module_path=/usr/local/lib/node_modules/v8-profiler/build/profiler/v5.7.0/node-v57-darwin-x64"

gyp ERR! cwd /usr/local/lib/node_modules/v8-profiler

gyp ERR! node -v v8.7.0

gyp ERR! node-gyp -v v3.6.2

gyp ERR! not ok

node-pre-gyp ERR! build error

node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/v8-profiler/build/profiler/v5.7.0/node-v57-darwin-x64/profiler.node --module_name=profiler --module_path=/usr/local/lib/node_modules/v8-profiler/build/profiler/v5.7.0/node-v57-darwin-x64' (1)

node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/v8-profiler/node_modules/node-pre-gyp/lib/util/compile.js:83:29)

node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)

node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)

node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)

node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

node-pre-gyp ERR! System Darwin 16.7.0

node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/v8-profiler/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd /usr/local/lib/node_modules/v8-profiler

node-pre-gyp ERR! node -v v8.7.0

node-pre-gyp ERR! node-pre-gyp -v v0.6.39

node-pre-gyp ERR! not ok

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/v8-profiler/build/profiler/v5.7.0/node-v57-darwin-x64/profiler.node --module_name=profiler --module_path=/usr/local/lib/node_modules/v8-profiler/build/profiler/v5.7.0/node-v57-darwin-x64' (1)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! v8-profiler@5.7.0 install: `node-pre-gyp install --fallback-to-build`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the v8-profiler@5.7.0 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

npm ERR! A complete log of this run can be found in:

0

if v8-profiler is not installed, you can't expect it to work... No surprise that the button is not there.

please see https://docs.npmjs.com/getting-started/fixing-npm-permissions for some hints on fixing npm permissions issues

0
Avatar
Permanently deleted user

I have successfully installed v8-profiler - still no buttons. I give up.

0

Please provide screenshots of your Run configuration, V8 profiling tab, and Run tool window (shown when executing this configuration)

0

Please sign in to leave a comment.