Forum Moderators: phranque

Message Too Old, No Replies

Script memory limit

Script memory limit

         

itnecor

7:15 pm on Aug 24, 2006 (gmt 0)

10+ Year Member



Can this effect the processing speed my PHP program?

memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

StupidScript

7:45 pm on Aug 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Only if you have (really) huge scripts that cache a lot of data while they work toward a result ... or many smaller, poorly-written scripts and a lot of traffic.

Typical PHP scripts that accomplish normal goals only use a tiny fraction of a MB. If you're running a big db query that grabs lots of data before rendering it you'll see more memory being used. Likewise if you have lots of hits on a script that collects lots of data or on scripts that are inefficiently written you will see more-than-average memory useage.

itnecor

9:02 am on Aug 25, 2006 (gmt 0)

10+ Year Member



Thanks StupidScript!

I'm creating a program that merging tif into a muti-page tif, and I've found it very slow, so it means the speed will increase if I add the memory limit of the scripts?

StupidScript

6:39 pm on Aug 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you will be running this script on-demand via user requests, perhaps there is some tweaking you could do to help it run more quickly without increasing the memory limit.

If you are just running it a few times to accomplish a task, privately, then increasing memory_limit will make it run a little faster, yes.

See the PHP manual [us3.php.net] for a description of memory_limit's purpose.

What you are doing with the TIFs, however, probably has less to do with swapping memory than with processor load. Displaying graphics is a memory hog, but manipulating them in the way you describe is very math-intensive, and is usually under the purview of the processor.