Ruby garbage collect

后端 未结 6 536
死守一世寂寞
死守一世寂寞 2020-12-29 03:34

When would you use this garbage collection method in your Ruby program(s)?

GC.start
6条回答
  •  情书的邮戳
    2020-12-29 04:02

    I use it when iterating through large numbers of items on memory constrained environments (Heroku) - I force a GC.start every 100 items or so.

提交回复
热议问题