node-dependency-tree icon indicating copy to clipboard operation
node-dependency-tree copied to clipboard

Out of memory without `--list-form`

Open binary64 opened this issue 4 years ago • 1 comments

I'm running this:

npx dependency-tree --directory=apps/web --ts-config=apps/web/tsconfig.json --list-form  apps/web/pages/index.tsx

But it takes ages and eventually dies with:

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb00d90 node::Abort() [node]
 2: 0xa1823b node::FatalError(char const*, char const*) [node]
 3: 0xcedbce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xcedf47 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xea6105  [node]
 6: 0xeb57dd v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 7: 0xeb84de v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 8: 0xe79642 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
 9: 0xe71c54 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
10: 0xe73cc1 v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node]
11: 0x124fb4c v8::internal::IncrementalStringBuilder::Extend() [node]
12: 0xf9e3e0 v8::internal::JsonStringifier::SerializeString(v8::internal::Handle<v8::internal::String>) [node]

However if I add the CLI flag --list-form, it works without crashing!

My project is a standard nx.dev repo.

Many thanks

binary64 avatar Dec 10 '21 11:12 binary64

Does this happen with the latest version and Node.js LTS?

XhmikosR avatar May 05 '23 07:05 XhmikosR