js-callgraph icon indicating copy to clipboard operation
js-callgraph copied to clipboard

Not able to run analysis for big projects

Open vrocky opened this issue 4 years ago • 1 comments

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 00007FF71CAF058F napi_wrap+109311 2: 00007FF71CA952B6 v8::internal::OrderedHashTablev8::internal::OrderedHashSet,1::NumberOfElementsOffset+33302 3: 00007FF71CA96086 node::OnFatalError+294 4: 00007FF71D36153E v8::Isolate::ReportExternalAllocationLimitReached+94 5: 00007FF71D3463BD v8::SharedArrayBuffer::Externalize+781 6: 00007FF71D1F084C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516 7: 00007FF71D1FBB8A v8::internal::Heap::ProtectUnprotectedMemoryChunks+1258 8: 00007FF71D1F8D39 v8::internal::Heap::PageFlagsAreConsistent+2457 9: 00007FF71D1ED961 v8::internal::Heap::CollectGarbage+2033 10: 00007FF71D1EBB65 v8::internal::Heap::AllocateExternalBackingStore+1317 11: 00007FF71D20BF57 v8::internal::Factory::NewFillerObject+183 12: 00007FF71CF3BE3F v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1039 13: 00007FF71D3E9EED v8::internal::SetupIsolateDelegate::SetupHeap+463949 14: 000000E0C39A917A

vrocky avatar Mar 29 '21 15:03 vrocky

You can increase the maximum amount of memory for node with export NODE_OPTIONS=--max-old-space-size=3000 (this means 3000MB)

Unfortunately, even if you have enough memory, if your "project" is really big you may run into another issue because in V8 strings have a maximum length, the call to JSON.stringify that js-callgraph does internally may fail. I am working on a PR that solves that right now.

icemonster avatar May 19 '21 13:05 icemonster