PHP5: Memory Limits Not Available?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I've been googling all day and I haven't seen anyone else having this
problem, so I thought I'd check to see if I'm unique or I should be
expecting this behavior.

I've recompiled and reinstalled my PHP SO for Apache with the configure
flag "--enable-memory-limit"  I'm running Apache 2.0.52 and PHP 5.0.3
(on FreeBSD 5.3).  After restarting Apache with the new PHP SO in
place, I checked phpinfo().  The "configure line" does, in fact, show
"--enable-memory-limit" as one of the many configure options.  However,
I've heard that there might also be a section or indication of memory
limit further down in the phpinfo() page.  I don't see anything (the
only time the word "memory" shows up on the page is for the configure
line)--not even the php.ini settings are shown in the table.

I've checked the PHP 5.0.4 changelog and there is no indication that
they touched the memory limit code.  There are currently no submitted
bugs regarding memory limits.  I also haven't found any indication that
this function might not be available in the Apache module form of PHP.

The most important problem I'm having is that the memory_get_usage()
function is not available.  I'm trying to write a small benchmarking
script to help generate statistics to compare scaling with large
amounts of database activity.  I hope to prove that my technique is
faster and uses less memory than an existing piece of code.  I've toyed
with the idea of reading the memory usage for the entire process using
ps, but that seems to scew things since, in addition to my script,
there's also a PHP interpreter with a bunch of overhead along with
whatever resources were necessary to open the shell and run ps.


Site Timeline