-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report Out of memory fatal error to Sentry #4148
Comments
Hi @LukasHirt, maybe you can use https://github.com/lloyd/node-memwatch package
|
Thank you @AtillaPehlivan for the hint. I already tried this package but unfortunately have an error when trying to install the package via npm. Maybe I'll try to spend some time trying to getting it to work. npm ERR! code 1
npm ERR! path /Users/lukashirt/Work/playeur/web/node_modules/memwatch
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/memwatch/src/heapdiff.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/lukashirt/.nvm/versions/node/v16.18.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/lukashirt/Work/playeur/web/node_modules/memwatch/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/lukashirt/.nvm/versions/node/v16.18.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/lukashirt/Library/Caches/node-gyp/16.18.1/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/lukashirt/Library/Caches/node-gyp/16.18.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/lukashirt/.nvm/versions/node/v16.18.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/lukashirt/Library/Caches/node-gyp/16.18.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/lukashirt/Work/playeur/web/node_modules/memwatch',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/heapdiff.cc:5:
npm ERR! ../src/heapdiff.hh:14:35: error: expected class name
npm ERR! class HeapDiff : public node::ObjectWrap
npm ERR! ^
npm ERR! ../src/heapdiff.hh:17:38: error: no template named 'Handle' in namespace 'v8'
npm ERR! static void Initialize ( v8::Handle<v8::Object> target );
npm ERR! ~~~~^
npm ERR! ../src/heapdiff.hh:19:20: error: no template named 'Handle' in namespace 'v8'
npm ERR! static v8::Handle<v8::Value> New( const v8::Arguments& args );
npm ERR! ~~~~^
npm ERR! ../src/heapdiff.hh:19:53: error: no type named 'Arguments' in namespace 'v8'
npm ERR! static v8::Handle<v8::Value> New( const v8::Arguments& args );
npm ERR! ~~~~^
npm ERR! ../src/heapdiff.hh:20:20: error: no template named 'Handle' in namespace 'v8'
npm ERR! static v8::Handle<v8::Value> End( const v8::Arguments& args );
npm ERR! ~~~~^
npm ERR! ../src/heapdiff.hh:20:53: error: no type named 'Arguments' in namespace 'v8'
npm ERR! static v8::Handle<v8::Value> End( const v8::Arguments& args );
npm ERR! ~~~~^
npm ERR! ../src/heapdiff.cc:30:34: error: member initializer 'ObjectWrap' does not name a non-static data member or base class
npm ERR! heapdiff::HeapDiff::HeapDiff() : ObjectWrap(), before(NULL), after(NULL),
npm ERR! ^~~~~~~~~~~~
npm ERR! ../src/heapdiff.cc:49:21: error: variable has incomplete type 'void'
npm ERR! heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
npm ERR! ^
npm ERR! ../src/heapdiff.cc:49:55: error: expected '(' for function-style cast or type construction
npm ERR! heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
npm ERR! ~~~~~~~~~~^
npm ERR! ../src/heapdiff.cc:49:38: error: no member named 'Handle' in namespace 'v8'
npm ERR! heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
npm ERR! ~~~~^
npm ERR! ../src/heapdiff.cc:49:57: error: use of undeclared identifier 'target'
npm ERR! heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
npm ERR! ^
npm ERR! ../src/heapdiff.cc:49:65: error: expected ';' after top level declarator
npm ERR! heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
npm ERR! ^
npm ERR! ;
npm ERR! ../src/heapdiff.cc:124:14: error: unknown type name 'idset'
npm ERR! void setDiff(idset a, idset b, vector<uint64_t> &c)
npm ERR! ^
npm ERR! ../src/heapdiff.cc:124:23: error: unknown type name 'idset'
npm ERR! void setDiff(idset a, idset b, vector<uint64_t> &c)
npm ERR! ^
npm ERR! ../src/heapdiff.cc:126:10: error: use of undeclared identifier 'idset'
npm ERR! for (idset::iterator i = a.begin(); i != a.end(); i++) {
npm ERR! ^
npm ERR! ../src/heapdiff.cc:174:25: error: use of undeclared identifier 'handleToStr'
npm ERR! type.append(handleToStr(node->GetName()));
npm ERR! ^
npm ERR! ../src/heapdiff.cc:202:29: error: no member named 'GetSelfSize' in 'v8::HeapGraphNode'
npm ERR! i->second.size += node->GetSelfSize() * (added ? 1 : -1);
npm ERR! ~~~~ ^
npm ERR! ../src/heapdiff.cc:211:8: error: no template named 'Handle'
npm ERR! static Handle<Value> changesetToObject(changeset & changes)
npm ERR! ^
npm ERR! ../src/heapdiff.cc:213:21: error: calling a protected constructor of class 'v8::HandleScope'
npm ERR! v8::HandleScope scope;
npm ERR! ^
npm ERR! /Users/lukashirt/Library/Caches/node-gyp/16.18.1/include/node/v8.h:1232:13: note: declared protected here
npm ERR! V8_INLINE HandleScope() = default;
npm ERR! ^
npm ERR! fatal error: too many errors emitted, stopping now [-ferror-limit=]
npm ERR! 20 errors generated.
npm ERR! make: *** [Release/obj.target/memwatch/src/heapdiff.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/Users/lukashirt/.nvm/versions/node/v16.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 22.4.0
npm ERR! gyp ERR! command "/Users/lukashirt/.nvm/versions/node/v16.18.1/bin/node" "/Users/lukashirt/.nvm/versions/node/v16.18.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/lukashirt/Work/playeur/web/node_modules/memwatch
npm ERR! gyp ERR! node -v v16.18.1
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok |
This happens to me using Sentry SvelteKit integration
|
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
Details
Lately I was repeatedly experiencing Out of memory issues in one project and I was hoping to report this error into my Sentry org. I tried using
process.on
with various events (e.g.exit
) but none of them were calling their listeners once the error happens.Is there any way to actually call a function on fatal error before the process is shutdown? I do not want to prevent the process, only send message to Sentry.
Node.js version
v16.18.1
Example code
The OOM error:
Operating system
macOS Ventura v13.2.1
Scope
runtime
Module and version
Not applicable.
The text was updated successfully, but these errors were encountered: