Why does this simple php script leak memory?

前端 未结 6 763
故里飘歌
故里飘歌 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:56

    My understanding of memory_get_usage() is that it's output can depend on a wide range of operating system and version factors.

    More importantly, unsetting a variable does not instantly free it's memory, deallocate it from the process, and give it back to the operating system (again, characteristics of this operation are operating system dependent).

    In short, you probably need a more complicated setup to look at memory leaks.

提交回复
热议问题