NYCPHP Meetup

NYPHP.org

[nycphp-talk] Memory Limit

Hans Zaunere hans at nyphp.org
Fri Jan 3 13:35:48 EST 2003


--- Sterling Hughes <sterling at bumblebury.com> wrote:
> > Hi,
> > 
> > There are two simple ways to have more free memory for your scripts :
> > 
> > 1- You can increase memory limit from 8 Mb to any amount in php.ini file.
> > 2- You can use 'unset()' function to unset unused variables right after
> you use them.
> >
> 
> err, that should only be php 3 specific, php4's reference counting
> mechanism releases all
> variables the second they are no longer referenced in the script.

But how would they become unreferenced without unset()ing them?


> > --- "Nunez, Eddy" <enunez at tiaa-cref.org> wrote:
> > > 
> > > This is in reference to the standard memory limit for server PHP

> scripts,
> > > which is 8MB.
> > > 
> > > My question is...
> > > is there any function to query available free space in the memory pool?

Maybe getrusage() would be handy, and I've attached a cheesy example I've
used to quickly profile scripts, and the posix_* functions look good, too. 
Plus, you could always run the UNIX commands and parse the output for mem
usage, what's free, etc on a system wide basis.


=====
Hans Zaunere
President, New York PHP
http://nyphp.org
hans at nyphp.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile.inc
Type: application/octet-stream
Size: 772 bytes
Desc: profile.inc
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030103/864f9742/attachment.obj>


More information about the talk mailing list