Ruby garbage collect

后端 未结 6 534
死守一世寂寞
死守一世寂寞 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:20

    Real life example:

    When testing a JSON streamer I want to make sure that the memory consumption remains low. Therefore I need to run GC.start before test cases or else they become unpredictable and can even produce false positives.

提交回复
热议问题