美文网首页
nodejs_bug修复

nodejs_bug修复

作者: AI信仰者 | 来源:发表于2021-10-28 11:24 被阅读0次

    1、Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

    <--- Last few GCs --->

    [3628:0000020F92556310] 101267813 ms: Mark-sweep 2045.8 (2063.6) -> 2045.7 (2061.1) MB, 823.6 / 0.0 ms (+ 217.9 ms in 2 steps since start of marking, biggest step 217.9 ms, walltime since start of marking 1052 ms) (average mu = 0.052, current mu = 0.011)

    <--- JS stacktrace --->

    ==== JS stack trace =========================================

    0: ExitFrame [pc: 00007FF78C61341C]
    

    Security context: 0x016990671ba1 <JSObject>
    1: parseMessage [00000302F1DB3371] [C:\Platform\node\service\node_modules\pg\lib\connection.js:~377] [pc=0000028DA566DDB0](this=0x03d27f47c261 <Connection map = 0000012A6A060F51>,0x03e134ba35c9 <Uint8Array map =
    0000012A6A065321>)
    2: /* anonymous */ [0000020ACD5EAF31] [C:\Platform\node\service\node_modules\pg\lib\connection.js:~119] [pc=0000028DA56...

    FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
    1: 00007FF78BAC094F napi_wrap+124431
    2: 00007FF78BA62696 v8::base::CPU::has_sse+34502
    3: 00007FF78BA63356 v8::base::CPU::has_sse+37766
    4: 00007FF78C266F4E v8::Isolate::ReportExternalAllocationLimitReached+94
    5: 00007FF78C24EF91 v8::SharedArrayBuffer::Externalize+833
    6: 00007FF78C11C85C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436
    7: 00007FF78C127C00 v8::internal::Heap::ProtectUnprotectedMemoryChunks+1312
    8: 00007FF78C124734 v8::internal::Heap::PageFlagsAreConsistent+3204
    9: 00007FF78C119FC3 v8::internal::Heap::CollectGarbage+1283
    10: 00007FF78C118794 v8::internal::Heap::AddRetainedMap+2356
    11: 00007FF78C140623 v8::internal::Factory::NewRawOneByteString+83
    12: 00007FF78C1434D2 v8::internal::Factory::NewStringFromUtf8+130
    13: 00007FF78C26386A v8::String::NewFromUtf8+298
    14: 00007FF78B9D76EF node::tracing::TraceEventHelper::SetAgent+40751
    15: 00007FF78BA79BFD v8::internal::Malloced::operator delete+1661
    16: 00007FF78C61341C v8::internal::SetupIsolateDelegate::SetupHeap+4562817: 0000028DA566DDB0

    2、<--- JS stacktrace --->
    Cannot get stack trace in GC.
    FATAL ERROR: MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed - JavaScript heap out of memory

    这个问题是node内存泄漏造成的。因为node是单线程的,所有的访问走的一个线程,如果执行完一个,占用内存增加,但是没有释放的话,就造成内存泄漏,内存泄漏其实就是存储泄漏,而造成的原因就是内存分配超过了v8内存的限制数量,而且进程所占用的内存,并没有慢慢释放回来,

    解决办法:node --max-old-space-size=6096 analysis.js

    相关文章

      网友评论

          本文标题:nodejs_bug修复

          本文链接:https://www.haomeiwen.com/subject/hgmkwhtx.html