PDA

View Full Version : Memory limit being used differs from Master Value set?


BadgerDog
02-29-2012, 11:42 AM
I have a problem that I've been looking for an answer to for months, so I thought I'd try a post here and see if anyone can help...

I have two 4.1.3 forums, a development forum and a live forum.

There's a "in use" PHP memory_limit variable that is different between the two forums, even though the Master Value is the same for both.

The Master Value 64M is set in PHP.INI file, but there's apparently also an actual "current real time" value 134217728 being set someplace else on the live forum and to -1 on the devforum that is a mystery.

Attached are a couple of pics that demonstrate the different values in the memory limit variable….

The one shows the values for the devforum and the other shows the values for the live forum.

I have no idea why it says -1 on the devforum and memory_limit 134217728 on the live forum, while the master value from php.ini on both environments shows 64M

I don't know where to change the variables that are currently being used by both forums to other values for testing? How can we track down where both forums are overriding the master 64M value someplace?

Thanks for any help ...

Regards,
Doug

kh99
02-29-2012, 01:27 PM
Searching the code I find a number of scripts with this line:

@ini_set('memory_limit', 128 * 1024 * 1024);


which changes that value, and 128 * 1024 * 1024 = 134217728. But I don't know why it would remain at that setting after the script ends, or why it would report different values between your two sites. Maybe it has something to do with web server threads or something.

BadgerDog
02-29-2012, 01:43 PM
Thank you for the quick response ... :)

What would a value of -1 represent? Unlimited allocation or something like that?

Regards,
Doug

kh99
02-29-2012, 01:46 PM
What would a value of -1 represent? Unlimited allocation or something like that?

Yes, looks like that's right. The php manual has a page of all variables that can be set, what the values mean, and where they can be set (some need to be set in the .ini file, others can be set by calling ini_set() in a script): http://us2.php.net/manual/en/ini.list.php

BadgerDog
03-02-2012, 12:19 PM
Thank you everyone ... :)

Regards,
Doug