Jump to content

[Question] memory_get_usage()


lovelycesar

Recommended Posts

I have a tiny code like this:

<?php
$memo_start = memory_get_usage(true);
// I do somthing here
$memo_end = memory_get_usage(true);
// calculate memory used
$memo_used = $memo_start - $memo_end;
?>

 

As of manual from php.net, it returns the amount of memory, in bytes, that's currently being allocated to your PHP script. However, at the beginning of my project, it shows 128 kb, now it shows 768 kb, with nothing changed from server's config. So, my question is: is this PHP function returns the amount of memory for whole PHP scripts on server or just a script standalone (this script) ?

 

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/260111-question-memory_get_usage/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.