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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.