memory_get_peak_usage() with “real usage”

后端 未结 5 1073
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 08:16

If the real_usage argument is set to true the PHP DOCS say it will get the real size of memory allocated from system. If it\'s false

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 08:54

    as per PHP memory_get_usage

    real_usage

    Set this to TRUE to get total memory allocated from system, including unused pages. If not set or FALSE only the used memory is reported.

    so to get the memory used by your script you should use memory_get_usage() as default real_usage is false.

    if you want to get the memory allocated by the system but don't care how much was actually used, use memory_get_usage(true);

提交回复
热议问题