我最近收到此错误。我试图检查节点--inspect
的内存问题根据本文:https://marmelab.com/blog/2018/04/03/how-to-track-and-fix-memory-leak-with-nodejs.html
,我看到一个base64类型的图像正在占用大量空间。但是我不知道如何解决?
如果您知道问题的根源,可以帮我吗?
<--- Last few GCs --->
[14924:00000251A069EDB0] 213715 ms: Mark-sweep 8054.8 (8231.9) -> 8054.7 (8200.9) MB, 112.9 / 0.0 ms (average mu = 0.431, current mu
= 0.017) last resort GC in old space requested
[14924:00000251A069EDB0] 214077 ms: Mark-sweep 8054.7 (8200.9) -> 8054.7 (8200.9) MB, 362.1 / 0.0 ms (average mu = 0.233, current mu
= 0.000) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00007FF688E4341C]
Security context: 0x00883a0808a1 <JSObject>
1: slice [000002B1175D6EF1] [buffer.js:~573] [pc=000000C1998DC266](this=0x01a0c4975c11 <Object map = 0000010D5A7E5E61>,0x01335e4b85c
9 <Uint8Array map = 0000010D5A7E5321>,6756536,10133659)
2: deserializeObject(aka deserializeObject) [0000029D28BE65E9] [C:\Users\iblue\Desktop\Medfitech\learnbetter-server\node_modules\bso
n\lib\bson\parser\deserializer...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 00007FF6882F094F napi_wrap+124431
2: 00007FF688292696 v8::base::CPU::has_sse+34502
3: 00007FF688293356 v8::base::CPU::has_sse+37766
4: 00007FF688A96F4E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF688A7EF91 v8::SharedArrayBuffer::Externalize+833
6: 00007FF68894C85C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436
7: 00007FF688948890 v8::internal::Heap::AddRetainedMap+2608
8: 00007FF688970623 v8::internal::Factory::NewRawOneByteString+83
9: 00007FF6889734D2 v8::internal::Factory::NewStringFromUtf8+130
10: 00007FF688A9386A v8::String::NewFromUtf8+298
11: 00007FF6882076EF node::tracing::TraceEventHelper::SetAgent+40751
12: 00007FF6882A9BFD v8::internal::Malloced::operator delete+1661
13: 00007FF688E4341C v8::internal::SetupIsolateDelegate::SetupHeap+45628
14: 000000C1998DC266
[nodemon] app crashed - waiting for file changes before starting... ```