php.ini's MEMORY_LIMIT value

biawokauns

Banned
May 8, 2004
176
0
0
It says per script in the config file, does this mean if I set it to 50MB, and TEN user use the script, 500MB of mem will be used? or, only 50MB total?

does that make any sense? i'm havin mem problems with a phpbb I set up that has 200+ forums :/
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
i'm no expert in php, but i'd assume that the script will make use of maximum 50mb with each call to the script, then the used memory will be released as soon as the script is done executing.

note that the configuration is for the *maximum* amount of memory a script may consume. it does not mean each script will eat up 50mb of memory. it will just use whatever is necessary up to 50mb.

now, where is amdfanboy when we need him? ,p
 

biawokauns

Banned
May 8, 2004
176
0
0
also I was thinking of using "-1" as the value for upload file limit, post limit, memory limit

is that a valid setting?
 

Templeton

Senior member
Oct 9, 1999
467
0
0
There is no way your script will ever consume 600mb... I'd be surprised if it even used 20. memory_limit sets the maximum ammount of memory given to each executed script... that means that if you set this to say 12mb (default), each time a user accesses your site, the script will be given 12mb to run with... if 10 people access the site at the same time, there can be up to 120mb used. If the script needs more then 12mb, then php will start garbage collecting old data to make room. Again, there isn't much of anything you could be doing to take 600mb for a single page load.
 

biawokauns

Banned
May 8, 2004
176
0
0
Okay thanks, I'll lower that then. I set up a local intranet with some forum system, and there are ~200 different forums. With the 8M default there were some problems :/