node-oom-heapdump 2.1.0-progress.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -2
- package/.github/workflows/publish-native-assets-to-github-releases.yml +37 -37
- package/.travis.yml +13 -9
- package/CHANGELOG.md +103 -84
- package/LICENSE +21 -21
- package/README.md +143 -143
- package/binding.gyp +9 -9
- package/build/binding.sln +19 -0
- package/build/node_oom_heapdump_native.vcxproj +145 -0
- package/build/node_oom_heapdump_native.vcxproj.filters +14 -0
- package/index.js +122 -133
- package/lib/cpuProfileWorker.js +48 -48
- package/lib/heapdumpWorker.js +48 -48
- package/lib/index.js +193 -227
- package/lib/node_oom_heapdump_native.cc +119 -110
- package/package.json +50 -51
- package/tests/index.js +27 -27
- package/tests/long_running_process.js +26 -26
- package/tests/long_running_process_cpu.js +34 -34
- package/tests/oom_app.js +21 -21
- package/build/Makefile +0 -324
- package/build/binding.Makefile +0 -6
- package/build/node_oom_heapdump_native.target.mk +0 -157
package/.eslintrc.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module.exports = {
|
2
|
-
"extends": "google"
|
1
|
+
module.exports = {
|
2
|
+
"extends": "google"
|
3
3
|
};
|
@@ -1,37 +1,37 @@
|
|
1
|
-
# This workflow will prebuild native binaries for supported NodeJS versions, and add them to the Github release that triggered the workflow
|
2
|
-
|
3
|
-
name: Add native binaries to release
|
4
|
-
|
5
|
-
on:
|
6
|
-
release:
|
7
|
-
types: [created]
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
augment-release:
|
11
|
-
runs-on: ${{ matrix.os }}
|
12
|
-
strategy:
|
13
|
-
matrix:
|
14
|
-
node-version: [
|
15
|
-
os: [ubuntu-latest, macos-latest, windows-latest]
|
16
|
-
steps:
|
17
|
-
- uses: actions/checkout@v2
|
18
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
19
|
-
uses: actions/setup-node@v1
|
20
|
-
with:
|
21
|
-
node-version: ${{ matrix.node-version }}
|
22
|
-
- name: patch node gyp on windows to support Visual Studio 2019
|
23
|
-
if: matrix.os == 'windows-latest'
|
24
|
-
shell: powershell
|
25
|
-
run: |
|
26
|
-
npm install --global node-gyp@5.1.1
|
27
|
-
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
|
28
|
-
- name: build using node-pre-gyp
|
29
|
-
run: |
|
30
|
-
npm install --build-from-source
|
31
|
-
./node_modules/.bin/node-pre-gyp package
|
32
|
-
- name: Upload native binaries for Node ${{ matrix.node-version }} for ${{ matrix.os }}
|
33
|
-
uses: csexton/release-asset-action@v2
|
34
|
-
with:
|
35
|
-
pattern: "build/stage/*.tar.gz"
|
36
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
37
|
-
release-url: ${{ github.event.release.upload_url }}
|
1
|
+
# This workflow will prebuild native binaries for supported NodeJS versions, and add them to the Github release that triggered the workflow
|
2
|
+
|
3
|
+
name: Add native binaries to release
|
4
|
+
|
5
|
+
on:
|
6
|
+
release:
|
7
|
+
types: [created]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
augment-release:
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
node-version: [10.x, 11.x, 12.x, 14.x, 15.x, 16.x]
|
15
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
19
|
+
uses: actions/setup-node@v1
|
20
|
+
with:
|
21
|
+
node-version: ${{ matrix.node-version }}
|
22
|
+
- name: patch node gyp on windows to support Visual Studio 2019
|
23
|
+
if: matrix.os == 'windows-latest'
|
24
|
+
shell: powershell
|
25
|
+
run: |
|
26
|
+
npm install --global node-gyp@5.1.1
|
27
|
+
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
|
28
|
+
- name: build using node-pre-gyp
|
29
|
+
run: |
|
30
|
+
npm install --build-from-source
|
31
|
+
./node_modules/.bin/node-pre-gyp package
|
32
|
+
- name: Upload native binaries for Node ${{ matrix.node-version }} for ${{ matrix.os }}
|
33
|
+
uses: csexton/release-asset-action@v2
|
34
|
+
with:
|
35
|
+
pattern: "build/stage/*.tar.gz"
|
36
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
37
|
+
release-url: ${{ github.event.release.upload_url }}
|
package/.travis.yml
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
language: node_js
|
2
|
-
node_js:
|
3
|
-
- "7"
|
4
|
-
- "8"
|
5
|
-
- "9"
|
6
|
-
- "10"
|
7
|
-
- "11"
|
8
|
-
- "12"
|
9
|
-
|
1
|
+
language: node_js
|
2
|
+
node_js:
|
3
|
+
- "7"
|
4
|
+
- "8"
|
5
|
+
- "9"
|
6
|
+
- "10"
|
7
|
+
- "11"
|
8
|
+
- "12"
|
9
|
+
- "13"
|
10
|
+
- "14"
|
11
|
+
- "15"
|
12
|
+
- "16"
|
13
|
+
script: npm run dummy
|
package/CHANGELOG.md
CHANGED
@@ -1,84 +1,103 @@
|
|
1
|
-
|
2
|
-
-
|
3
|
-
- Added
|
4
|
-
|
5
|
-
|
6
|
-
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
-
|
15
|
-
|
16
|
-
-
|
17
|
-
|
18
|
-
-
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
-
|
23
|
-
|
24
|
-
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
|
32
|
-
|
33
|
-
- 1.
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
|
45
|
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
- 1.0
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
-
|
67
|
-
|
68
|
-
|
69
|
-
- 1.0.
|
70
|
-
|
71
|
-
|
72
|
-
- 1.0.
|
73
|
-
|
74
|
-
|
75
|
-
-
|
76
|
-
|
77
|
-
|
78
|
-
-
|
79
|
-
|
80
|
-
|
81
|
-
-
|
82
|
-
|
83
|
-
|
84
|
-
-
|
1
|
+
10-02-2022 Paul Rütter
|
2
|
+
- 3.0.0
|
3
|
+
- Added Node 16 support (by merging https://github.com/blueconic/node-oom-heapdump/pull/20, Thanks Simon Abbott!).
|
4
|
+
This fixes a recursion issue.
|
5
|
+
- Removed "GC_MONITORING" at it relied on `gc-stats`, which is no longer maintained (and contained security issues)
|
6
|
+
- Updated `node-pre-gyp` to `@mapbox/node-pre-gyp` so security issues are mitigated
|
7
|
+
|
8
|
+
12-10-2020 Paul Rütter
|
9
|
+
- 2.1.0
|
10
|
+
- Added Node 14 support
|
11
|
+
|
12
|
+
12-10-2020 Paul Rütter
|
13
|
+
- 2.0.2
|
14
|
+
- Fix latest published version, was replaced with beta.
|
15
|
+
|
16
|
+
02-08-2020 Paul Rütter
|
17
|
+
- 2.0.1
|
18
|
+
- Fixed prebuilt binaries path.
|
19
|
+
|
20
|
+
20-07-2020 Paul Rütter
|
21
|
+
- 2.0
|
22
|
+
- Added prebuilt binaries again, in a new major version. To "solve" https://github.com/blueconic/node-oom-heapdump/issues/13.
|
23
|
+
|
24
|
+
20-07-2020 Paul Rütter
|
25
|
+
- 1.3.1
|
26
|
+
- Revert prebuilt binaries, since it's a breaking change.
|
27
|
+
|
28
|
+
24-06-2020 Stuart Miller / Paul Rütter
|
29
|
+
- 1.3.0
|
30
|
+
- Stuart Miller added support for having prebuilt binaries for all supported Node.js versions.
|
31
|
+
|
32
|
+
16-10-2019 Paul Rütter
|
33
|
+
- 1.2.0
|
34
|
+
- Node 12 support.
|
35
|
+
- Still some deprecated API's are used, which should be avoided.
|
36
|
+
See https://github.com/joyeecheung/node/blob/v8-maybe-doc/CPP_STYLE_GUIDE.md#use-maybe-version-of-v8-apis
|
37
|
+
- Adjusted test script a bit, by removing some flags which seem to complicate nodejs 12 support.
|
38
|
+
|
39
|
+
02-09-2019 Paul Rütter
|
40
|
+
- 1.2.0-beta.0
|
41
|
+
- Updated dependencies (nan update is needed for nodejs 12)
|
42
|
+
- Add nodejs 12 to travis
|
43
|
+
- Add experimental node 12 support. Still some deprecated API's are used, which should be avoided.
|
44
|
+
See https://github.com/joyeecheung/node/blob/v8-maybe-doc/CPP_STYLE_GUIDE.md#use-maybe-version-of-v8-apis
|
45
|
+
|
46
|
+
02-01-2019 Paul Rütter
|
47
|
+
- 1.1.4
|
48
|
+
- Updated dependencies
|
49
|
+
- Add travis file to trigger a build. Just run a dummy script which does nothing; the default "npm install" will check if the native module compiles.
|
50
|
+
|
51
|
+
09-06-2018 Paul Rütter
|
52
|
+
- 1.1.3 - Updated dependencies, to mitigate security issues.
|
53
|
+
|
54
|
+
02-20-2018 Paul Rütter
|
55
|
+
- 1.1.2 - Fixed heapdump generation on Unix machines.
|
56
|
+
- Added option to use the "old" implementation (GCmonitoring), as the new implementatuion is more prone to run in with the OoM killer when in memory restricted environments (like Docker). The old implementation was less impacted by this, because the "threshold" parameter can be used to create the heapdump earlier.
|
57
|
+
You can specify which OoM implementation to use, either: "NATIVE_HOOK" (default) or "GC_MONITORING" (old implementation).
|
58
|
+
|
59
|
+
02-19-2018 Paul Rütter
|
60
|
+
- 1.1.0 - Changed the way the "out of memory" heapdump is created, based on the work of 'trevnorris' (https://github.com/trevnorris/node-ofe/blob/master/ofe.cc). Using V8 engine isolate.SetOOMErrorHandler() to hook in on the out of memory event.
|
61
|
+
- Updated readme and removed deprecated 'limit' and 'threshold' parameters.
|
62
|
+
- Removed 'gc-stats' module, as we no longer need it with the native C++ add-on.
|
63
|
+
|
64
|
+
02-13-2018 - Paul Rütter
|
65
|
+
- 1.0.12 - Use 'require-main-filename' instead of require.main.filename, to resolve 'https://github.com/blueconic/node-oom-heapdump/issues/3'.
|
66
|
+
- Upgrade dependencies
|
67
|
+
|
68
|
+
11-21-2017 - Paul Rütter
|
69
|
+
- 1.0.11 - Added port verification; when the module is loaded, the configured WebSocket port is verified. If the websocket responds with ECONNREFUSED, the process might have been started without the --inspect flag.
|
70
|
+
|
71
|
+
11-17-2017 - Paul Rütter
|
72
|
+
- 1.0.10 - Use gc-stats to calculate when to make a OoM heapdumo instead of process.memoryUsage() as this memory information (heapTotal) is growing over time, which is not expected.
|
73
|
+
- Stringify gc-stats output, so it runs over only 1 line.
|
74
|
+
|
75
|
+
06-10-2017 - Paul Rütter
|
76
|
+
- 1.0.9 - Handle exit codes better and reject promise if so.
|
77
|
+
|
78
|
+
05-10-2017 - Paul Rütter
|
79
|
+
- 1.0.8 - Add CPU profile functionality.
|
80
|
+
|
81
|
+
04-10-2017 - Paul Rütter
|
82
|
+
- 1.0.7 - Add addTimestamp option.
|
83
|
+
|
84
|
+
04-10-2017 - Paul Rütter
|
85
|
+
- 1.0.6 - Add limit option.
|
86
|
+
|
87
|
+
03-10-2017 - Paul Rütter
|
88
|
+
- 1.0.5 - Change heap calculation.
|
89
|
+
|
90
|
+
03-10-2017 - Paul Rütter
|
91
|
+
- 1.0.4 - Add error handler in case the calling process is not running anymore. Also, block execution a while to allow heapdump to be created.
|
92
|
+
|
93
|
+
01-10-2017 - Paul Rütter
|
94
|
+
- 1.0.3 - Minor doc changes.
|
95
|
+
|
96
|
+
01-10-2017 - Paul Rütter
|
97
|
+
- 1.0.2 - Refactored code; split up API and implementation. Also added API for creating heapdumps on the fly. Documentation updated.
|
98
|
+
|
99
|
+
29-09-2017 - Paul Rütter
|
100
|
+
- 1.0.1 - minor changed
|
101
|
+
|
102
|
+
29-09-2017 - Paul Rütter
|
103
|
+
- 1.0.1 - initial version
|
package/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2017 BlueConic
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 BlueConic
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|