与内存相关的node.js框架错误

时间:2019-04-25 14:15:44

标签: javascript node.js express

嘿,我正在尝试运行我的JavaScript程序,但出现此内存错误,究竟是什么问题?

<--- Last few GCs --->

[12908:0000015EB93DE800]    29162 ms: Mark-sweep 1396.7 (1425.2) -> 1396.3 (1424.2) MB, 2989.7 / 0.0 ms  (average mu = 0.077, current mu = 0.009) allocation failure scavenge might not succeed
[12908:0000015EB93DE800]    29171 ms: Scavenge 1397.2 (1424.2) -> 1396.8 (1425.2) MB, 7.2 / 0.0 ms  (average mu = 0.077, current mu = 0.009) allocation failure


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 000000353CE5C5C1]
    1: StubFrame [pc: 000000353CE5D9BF]
Security context: 0x00284931e6e1 <JSObject>
    2: /* anonymous */ [0000024169ED4C29] [C:\Users\lenovo\Desktop\ZakariaElkarma\projet_test\pre-final_Max_CA.js:~79] [pc=000000353D30CCF7](this=0x03a82119ad11 <JSGlobal Object>,err=0x004e654026f1 <undefined>,newdest=0x024169ed5251 <JSArray[2926]>)
    3: arguments adaptor frame: 3->2
    4: /* anonymous */ [0000024...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF731190EFA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810
 2: 00007FF73116A296 node::MakeCallback+4518
 3: 00007FF73116AC80 node_module_register+2160
 4: 00007FF7314009BE v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF7314008EF v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF73193E954 v8::internal::Heap::MaxHeapGrowingFactor+11476
 7: 00007FF7319350B7 v8::internal::ScavengeJob::operator=+25543
 8: 00007FF73193362C v8::internal::ScavengeJob::operator=+18748
 9: 00007FF73193C5A7 v8::internal::Heap::MaxHeapGrowingFactor+2343
10: 00007FF73193C626 v8::internal::Heap::MaxHeapGrowingFactor+2470
11: 00007FF7314DF447 v8::internal::Factory::NewFillerObject+55
12: 00007FF73157712A v8::internal::WasmJs::Install+29530
13: 000000353CE5C5C1

我尝试了node --max-old-space-size=4096 myscript.js,但是它不起作用,我也尝试了node -r ts-node/register --max-old-space-size,但又给了我另一个错误:Error: missing value for flag --max-old-space-size of type size_t

这是我的代码的一部分:

               "     where iif("+item+">=60,a.[ACT_Type],iif( "+item+"  % 5 =0 or  "+item+"  % 5=1 ,'738',iif(a.[ACT_Type]='788','788','789')))=a.[ACT_Type] "
                    ,function (err, newdest) {  ( line 79 )
                    if (err) console.log(err);
                    console.log("Newdesc selectioné pour l'itération N° "+item); 
                    var pop=algorithme_Genetique.populationInitial();
                    var req_Individu       =" ";
                    var req_newVols        =" ";
                    var req_newVols_direct =" ";
                    var req_recherche_local="";                                  
                    var it=item;

1 个答案:

答案 0 :(得分:0)

除非您发布代码的某些部分,否则我无法确定告诉您什么。

但是从提供的错误看来,您的程序似乎在此行附近的无限循环中运行

  

C:\ Users \ lenovo \ Desktop \ ZakariaElkarma \ projet_test \ pre-final_Max_CA.js:〜79