Kagami / ffmpeg.js

Port of FFmpeg with Emscripten
Other
3.24k stars 329 forks source link

Heap memory error #155

Open javiteri95 opened 3 years ago

javiteri95 commented 3 years ago

Hi, I have some issues using your package with react-scripts start. At the moment of starting my project the amount of memory used skyrocket to at least 30% in a 16GB computer. I try running again with --max_old_space_size=15000 and same result.

I work with nvm and tried with node 15.8.0 and 14.15.4 (LTS). Library version is 4.2.9003

<--- Last few GCs --->

[26741:0x49d3b50]    36459 ms: Scavenge 4037.4 (4123.0) -> 4033.6 (4125.5) MB, 8.2 / 0.0 ms  (average mu = 0.935, current mu = 0.934) allocation failure 
[26741:0x49d3b50]    36579 ms: Scavenge 4039.5 (4125.5) -> 4037.0 (4134.7) MB, 7.9 / 0.0 ms  (average mu = 0.935, current mu = 0.934) allocation failure 
[26741:0x49d3b50]    39589 ms: Mark-sweep 4048.9 (4134.7) -> 4043.0 (4146.7) MB, 2780.4 / 0.1 ms  (average mu = 0.699, current mu = 0.293) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
 1: 0xa747f0 node::Abort() [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 2: 0x9a1c4d node::FatalError(char const*, char const*) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 3: 0xc5d08e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 4: 0xc5d407 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 5: 0xe26c95  [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 6: 0xe56223 v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 7: 0xe62dd6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 8: 0xe4eeff v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
 9: 0xe4f178 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
10: 0xe40f99 v8::internal::ItemParallelJob::Run() [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
11: 0xe64d60 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
12: 0xe655a3 v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
13: 0xe65965 v8::internal::MarkCompactCollector::Evacuate() [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
14: 0xe780d1 v8::internal::MarkCompactCollector::CollectGarbage() [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
15: 0xe33f98 v8::internal::Heap::MarkCompact() [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
16: 0xe35928 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
17: 0xe38ecc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
18: 0xdfcdea v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
19: 0x1153b7b v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
20: 0x14ea8f9  [/home/jose/.nvm/versions/node/v15.8.0/bin/node]
abacaj commented 3 years ago

Same issue, can't import the library crashes application.

AhmedElyamani commented 2 years ago

I'm facing the same issue.

vladmdgolam commented 2 years ago

Yes, same issue, can be caused by import scripts in the module.

vasaf commented 2 years ago

Same issue, anyone manage to solve this?

davidspura commented 2 years ago

Still facing this issue today, application crashes on startup when library is imported.

ndrewtl commented 2 years ago

Getting the same issue here

RajanTpss commented 1 year ago

Still facing this issue today, application crashes on startup when library is imported.

image

anyone manage to solve this?

simonwidjaja commented 1 year ago

Getting the same issue here. Any solutions or workarounds highly appreciated.

leonid-belikov commented 3 months ago

Same