当使用 --trace-gc 选项时,我从 node.js 得到以下输出
[24851] 852 ms: Scavenge 26.8 (57.2) -> 20.8 (58.2) MB, 3.1 ms [allocation failure].
[24851] 927 ms: Scavenge 28.7 (58.2) -> 22.4 (59.2) MB, 2.0 ms [allocation failure].
[24851] 1013 ms: Scavenge 30.4 (61.2) -> 24.1 (61.2) MB, 2.3 ms [allocation failure].
[24851] 1067 ms: Scavenge 31.6 (62.2) -> 24.8 (62.2) MB, 2.1 ms [allocation failure].
[24851] Speed up marking because marker was not keeping up
[24851] Postponing speeding up marking until marking starts
[24851] Speed up marking because marker was not keeping up
[24851] Postponing speeding up marking until marking starts
[24851] Speed up marking because marker was not keeping up
[24851] Postponing speeding up marking until marking starts
[24851] 1359 ms: Mark-sweep 90.9 (115.1) -> 53.6 (113.7) MB, 9.0 ms (+ 19.3 ms in 105 steps since start of marking, biggest step 1.7 ms) [GC interrupt] [GC in old space requested].
[24851] 1578 ms: Scavenge 69.6 (113.7) -> 62.4 (115.7) MB, 6.0 ms [allocation failure].
[24851] 1676 ms: Scavenge 73.1 (117.7) -> 64.1 (121.7) MB, 5.9 ms [allocation failure].
有人可以解释上面输出中每一项的含义吗?
最佳答案
我也没有看到任何关于此的文档,但查看了 process.memoryusage()
的结果连同使用 --trace_gc
选项建议:
Scavenge <heapUsed before> (<heapTotal before>) -> <heapUsed after> (<heapTotal after>) MB, <how long the GC pause was>
heapUsed
和 heapTotal
由 process.memoryusage()
记录, 但更好地解释了 by this answer .
关于node.js - node.js --trace-gc 输出的含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33746184/