Skip to content

Commit

Permalink
After research, it seems that the "--optimize_for_size --always_compa…
Browse files Browse the repository at this point in the history
…ct" flags seem to be the cause of Node.js 12 not working stable with this module.

When removing those, it works as on older node versions.

Published 1.2.0 version to npm repo.
  • Loading branch information
paulrutter committed Oct 16, 2019
1 parent 2f49838 commit fac8e92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
02-09-2019 Paul Rütter
16-10-2019 Paul Rütter
- 1.2.0
- Node 12 support.
- Still some deprecated API's are used, which should be avoided.
See https://github.com/joyeecheung/node/blob/v8-maybe-doc/CPP_STYLE_GUIDE.md#use-maybe-version-of-v8-apis
- Adjusted test script a bit, by removing some flags which seem to complicate nodejs 12 support.

02-09-2019 Paul Rütter
- 1.2.0-beta.0
- Updated dependencies (nan update is needed for nodejs 12)
- Add nodejs 12 to travis
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Node module which will create a V8 heap snapshot right before an "Out of Memory"

It can also create heapdumps and CPU profiles on request like 'v8-profiler', but does this off-process so it doesn't interfere with execution of the main process.

Tested on Node.js 7.x, 8.x, 9.x, 10.x and 11.x.
Tested on Node.js 7.x, 8.x, 9.x, 10.x, 11.x and 12.x.
No support for Node.js < 7.0 at the moment (although this can be fixed if needed).

# Why?
Expand Down Expand Up @@ -52,6 +52,7 @@ When running in a low memory environment, the following flags are advised:
* --always_compact - keep memory as low as possible (do compactions each GC)

These might impact performance though.
On Node.js 12.x the latter two flags seem to cause some stability issues (see https://github.com/nodejs/node/issues/27552#issuecomment-542695931). So, if you encounter issues on Node.js 12.x in combination with those flags, please refrain from using these.

# Options
* heapdumpOnOOM - boolean whether to create a heapdump when an out of memory occurs. Default true.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "node-oom-heapdump",
"version": "1.2.0-beta.0",
"version": "1.2.0",
"description": "Create a V8 heap snapshot when an \"Out of Memory\" error occurs, or create a heap snapshot or CPU profile on request.",
"main": "index.js",
"scripts": {
"test": "node --max_old_space_size=80 --optimize_for_size --always_compact --inspect tests\\oom_app.js",
"test": "node --max_old_space_size=80 --inspect ./tests/oom_app.js",
"dummy": "node -e \"process.exit(0)\""
},
"repository": {
Expand Down

0 comments on commit fac8e92

Please sign in to comment.