memory_get_usage question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

memory_get_usage question

Post by josh »

Parameters

real_usage

Set this to TRUE to get the real size of memory allocated from system. If not set or FALSE only the memory used by emalloc() is reported.


What is the difference between emalloc() and what exactly is a "real memory allocation"?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: memory_get_usage question

Post by Benjamin »

josh wrote:What is the difference between emalloc() and what exactly is a "real memory allocation"?
It would appear that the real memory allocation is how much was attempted to be allocated vs how much actually was allocated.

http://www.dgp.toronto.edu/~ajr/270/a2/soln/emalloc.c
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: memory_get_usage question

Post by Weirdan »

It's not the emalloc used in Zend memory manager.
Post Reply