Clear memory being used by PHP

后端 未结 4 641
清歌不尽
清歌不尽 2021-02-05 21:54

I\'m running into an interesting problem. I\'m using PHPUnit, and my tests take more memory every single time I run them. Ie...

2.25 MB

2.5 MB

3.0 MB

4条回答
  •  鱼传尺愫
    2021-02-05 22:23

    Calvin, as per discussed in the chat, it was due to missing reset features.

    When testing, we must ensure that the test environment is consistent so that we're able to get accurate results. Computing is Input/Output and hence we should use Fixtures in PHPUnit to reset storage to prevent "memory leaks" like these.

提交回复
热议问题