My MCVE jest następującyPętla console.log w nodejs
var i = 0;
for(;;)
console.log(i++)
Kiedy robię to, w pewnym momencie, mój nodejs
prostu przestaje drukować rzeczy, dając mi moc, która wygląda tak
[...]
684665
684666
684667
A potem, mam to:
<--- Last few GCs --->
69097 ms: Scavenge 1397.2 (1456.7) -> 1397.2 (1456.7) MB, 0.8/0 ms (+ 1.7 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
70462 ms: Mark-sweep 1397.2 (1456.7) -> 1396.0 (1456.7) MB, 1364.9/0 ms (+ 2.8 ms in 2 steps since start of marking, biggest step 1.7 ms) [last resort gc].
71833 ms: Mark-sweep 1396.0 (1456.7) -> 1397.1 (1456.7) MB, 1370.2/0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0xcdf79d37399 <JS Object>
1: formatPrimitive(aka formatPrimitive) [util.js:~411] [pc=0x634d9f4113f] (this=0xcdf79d04131 <undefined>,ctx=0x17b18f4d561 <an Object with map 0x32fd25043ef9>,value=16248021)
2: formatValue(aka formatValue) [util.js:223] [pc=0x634d9f1fdbb] (this=0xcdf79d04131 <undefined>,ctx=0x17b18f4d561 <an Object with map 0x32fd25043ef9>,value=16248021,recurseTimes=2)
3: inspect(aka inspect) [uti...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
[1] 19446 abort (core dumped) node
zastanawiałem się, co można zrobić, że console.log
może spowodować błąd braku pamięci?
Myślę, że to przepełnia bufor i trzeba go przepłukać – Hristo
@ Chris zredagowałem mój post, to nie był problem z kolorami – tforgione
Może warto otworzyć bilet w repozytorium [NodeJS] (https://github.com/ nodejs/node/issues) link do tego pytania. –