Re: PHP memory usage
| From: | Fernando Serboncini | Date: | Fri, 03 Jan 2003 03:25:23 +0000 |
| Subject: | Re: PHP memory usage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130036@lists.php.net to get a copy of this message | ||
I don't know if I'm talking bullshit, but don't forget that each parameter
or return valeu in php, if not explicited as a pointer, it's a copy of the
full parameter.
This way, any
function a(myclass c)
{
return c;
}
would create another copy of "c" in memory. Things get a bit larger when you
go with linked-list like structures in classes, where you have to take
really good care to don't duplicate data. If you're not taking care, then
maybe 5MB is normal.
IMHO, I agree with splitting the class into smaller functions. 370KB is a
big thing, that maybe useless. PHP isn't Java so you're not suposed to do a
"class mysite"
[]s
Fernando
"James H. Thompson" <jht@lava.net> wrote in message
news:20030102215354.63611.qmail@pb1.pair.com...
> We have a good size PHP libary -- about 370KB of source code.
> Its one class with a multitude of small functions in it.
> just doing a require_once() on this library appears to use about 5MB of
> memory.(the change in VmSize in /proc/self/status)
>
> Is this a normal ratio of PHP source code size to executable size?
>
>
> --
> Jim
>
> James H. Thompson
> jht@lava.net
>
>