Upload error "memory size exhausted" / "Out of memory" Upload error "memory size exhausted" / "Out of memory"
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Upload error "memory size exhausted" / "Out of memory"

Started by Saber Rider, September 15, 2013, 12:12:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Saber Rider

When I upload pictures via batch I get the following error on some pictures "Fatal error: Allowed memory size of 94371840 bytes exhausted..."
No big problem, as I found the solution in the coppermine documentation.
http://documentation.coppermine-gallery.net/en/upload_troubleshooting.htm#upload_trouble_memory_usage

So I followed these steps.
First of all I wanted to know how much memory the image uses.
There is a description in the documentation how you can calculate the amount of memory an image uses.

My image has following resolution: 5760x3840  standard RGB

Calculation is:
5760 x 3840 x 3 / 1048576 = 63.3 MB

After that I checked the php setting ,,memory_limit".
As the error message says it is set to 90 MB, so it should be enough.

Why do I get this error message?


cpg version is 1.5.24

btw: if I change the memory_limit of php to 100MB or more I get another error message "out of memory..." and the icon changes to a "radar-icon"

phill104

Sometimes you increase the memory limit but it is beyond either soft limits imposed by your hose or hard limits of the server hence the out of memory error.

I am guessing that you are getting the error in the first place because along with the size of the image you have to take into account the usage by CPG itself and possibly any other scripts your server may be running.

Other options are to use the HTML5 uploader or Jupload or use a lower res image.
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

Additional to Phill's information Coppermine/PHP needs additional memory to create the resized version of your image. Depending on your settings Coppermine needs to calculate each image up to 4 times during upload. I haven't checked that, but I assume PHP needs to allocate memory for just 2 pictures simultaneously. But even that may be already too much (e.g. if you resize your full-sized version to something slightly smaller than your uploaded pictures, like QXGA resolution).

Saber Rider

Thanks for the help so far.

I did a test with the HTML5 plugin but it didn´t work and no error message appears. Only a message "Album is empty".
Maybe JUpload can handle it but im not a fan of Java applets as I had lately much trouble with the permanent changing security policies of Java...

I will resize the images now. I think thats the best solution.


The assumption PHP needs to allocate memory for 2 pictures simultaneously sounds interresting.
Maybe you have to add "x 2" to the calculation which would approximately correspond my tests.





Αndré

Quote from: Saber Rider on September 16, 2013, 06:58:24 PM
Maybe you have to add "x 2" to the calculation which would approximately correspond my tests.
It's actually equal or less than "x 2", according what exactly is done (i.e. you need less memory when creating thumbnail or intermediate-sized pictures, as they have smaller dimensions).