Welcome Guest, Not a member yet? Register   Sign In
php memory limit
#1

[eluser]otn3m3m[/eluser]
hi,

i have page where a user uploads an image and the image is resized as a thumbnail.
I was having memory errors when resizing the image. I would get “Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1400 bytes) in ..."

I eventually found that if set the memory limit to 128 M the errors disappear.

My question is how will this memory allocation affect the performance of my production server when multiple users are uploading images. Will the server just run of memory and show the same error?

thanks
#2

[eluser]bretticus[/eluser]
Depending on how Apache is configured, it forks a child process for every request. The limit is not cumulative. As soon as PHP parses the script, the process terminates and the memory is given back to the OS. Your server should have at least a GB of memory and several hundred MB free. Even then, you have memory swapping to your hard drive.




Theme © iAndrew 2016 - Forum software by © MyBB