Running garbage collection manually in node

后端 未结 3 551
感情败类
感情败类 2020-12-15 08:33

I am using node and am considering manually running garbage collection in node. Is there any drawbacks on this? The reason I am doing this is that it looks like node is not

3条回答
  •  甜味超标
    2020-12-15 09:09

    V8 Run garbage collection when he think it's interessting. There is no fixed delay for that. You can read this article to learn about garbage collection V8 : https://strongloop.com/strongblog/node-js-performance-garbage-collection/

    Anyway it's a bad idea to run manually the garbage collector in your project because it blocked completely the node process. So during the garbage collection your program wont handle any request.

提交回复
热议问题