在Node.js中禁用GC

有没有办法完全禁用GC(或)清道夫,至less? 在这里find讨论 – https://github.com/nodejs/help/issues/462在这里 – https://twitter.com/dolftax/status/825742173698142209

我试过node --nouse_idle_notification --trace_gc --max-old-space-size=1000 --max-semi-space-size=64 --noconcurrent_sweeping example.js

Scavenge和Mark-Sweep都不停止。 请参阅Github问题了解更多信息。

我的问题是,我错过了什么? 还有什么我可以做,让GC不能运行。 仅供参考,这是为了实验目的,不希望不停止GC的替代解决scheme。

节点v7.9.0

V8 5.4.500.45

我设法按要求弯曲GC运行。

node --max-old-space-size=1000 --max-semi-space-size=512 --noconcurrent_sweeping example.js

在运行Mark Sweep之前,确实已经等待最大旧空间大小达到1000 MB。