tchvu3 / capacitor-voice-recorder

Capacitor plugin for voice recording
69 stars 57 forks source link

Memory leak issue #14

Closed lenkwe closed 2 years ago

lenkwe commented 2 years ago

After introducing "capacitor-voice-recorder" only works with more than 4GB memory, it can only build with 8GB. This occurs even in an example project with only voice-recorder.

<--- Last few GCs --->

[40317:0x104e00000] 920452 ms: Mark-sweep (reduce) 4094.2 (4102.2) -> 4093.8 (4103.5) MB, 44767.0 / 0.0 ms (average mu = 0.214, current mu = 0.001) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory 1: 0x10130d6e5 node::Abort() (.cold.1) [/usr/local/bin/node] 2: 0x1000b1c49 node::Abort() [/usr/local/bin/node] 3: 0x1000b1daf node::OnFatalError(char const, char const) [/usr/local/bin/node] 4: 0x1001f60f7 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/usr/local/bin/node] 5: 0x1001f6093 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [/usr/local/bin/node] 6: 0x1003a54f5 v8::internal::Heap::FatalProcessOutOfMemory(char const) [/usr/local/bin/node] 7: 0x100400513 v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/usr/local/bin/node] 8: 0x1003e7c7b void v8::internal::LiveObjectVisitor::VisitBlackObjectsNoFail<v8::internal::EvacuateNewSpaceVisitor, v8::internal::MajorNonAtomicMarkingState>(v8::internal::MemoryChunk, v8::internal::MajorNonAtomicMarkingState, v8::internal::EvacuateNewSpaceVisitor, v8::internal::LiveObjectVisitor::IterationMode) [/usr/local/bin/node] 9: 0x1003e78a5 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk, long) [/usr/local/bin/node] 10: 0x1003e7516 v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk) [/usr/local/bin/node] 11: 0x100404e1e v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/usr/local/bin/node] 12: 0x1003bffc2 v8::internal::ItemParallelJob::Task::RunInternal() [/usr/local/bin/node] 13: 0x1003c042f v8::internal::ItemParallelJob::Run() [/usr/local/bin/node] 14: 0x1003e9509 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector, v8::internal::ItemParallelJob, v8::internal::MigrationObserver, long) [/usr/local/bin/node] 15: 0x1003e9141 v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/usr/local/bin/node] 16: 0x1003d5107 v8::internal::MarkCompactCollector::Evacuate() [/usr/local/bin/node] 17: 0x1003d2993 v8::internal::MarkCompactCollector::CollectGarbage() [/usr/local/bin/node] 18: 0x1003a5bbb v8::internal::Heap::MarkCompact() [/usr/local/bin/node] 19: 0x1003a2169 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node] 20: 0x10039ff21 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node] 21: 0x1003ae7da v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node] 22: 0x1003ae861 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node] 23: 0x10037bf12 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node] 24: 0x1006fc158 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [/usr/local/bin/node] 25: 0x100a893d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node] 26: 0x100a63a62 Builtins_MapConstructor [/usr/local/bin/node] 27: 0x100a1e421 Builtins_JSBuiltinsConstructStub [/usr/local/bin/node] 28: 0x2e71f63dcdb5 29: 0x2e71f63d3281 30: 0x2e71f63e0456 31: 0x2e71f63d3235

tchvu3 commented 2 years ago

Hey there, it would be very helpful if you'll tell me which os it happened on. would be even better if you have a small project which demonstrates this issue

tchvu3 commented 2 years ago

I failed to recreate this issue, nor have you provided any guidance as to how this bug has seemed to have happened to you. I'll close this issue for now, but if it happens again please let me know and provide me with additional info