Why does this simple php script leak memory?

前端 未结 6 766
故里飘歌
故里飘歌 2020-12-28 18:05

In hopes of trying to avoid future memory leaks in php programs (drupal modules, etc.) I\'ve been messing around with simple php scripts that leak memory.

Could a ph

6条回答
  •  甜味超标
    2020-12-28 18:47

    I'm not sure about the exact workings of it in PHP, but in some other languages an object containing other objects, when set to null, does not inherently set the other objects to null. It terminates the reference to those objects, but as PHP does not have "garbage collection" in a Java sense, the sub-objects exist in memory until they are removed individually.

提交回复
热议问题