Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Upload error "memory size exhausted" / "Out of memory"  (Read 4806 times)

0 Members and 1 Guest are viewing this topic.

Saber Rider

  • Coppermine newbie
  • Country: de
  • Offline Offline
  • Posts: 2
Upload error "memory size exhausted" / "Out of memory"
« on: September 15, 2013, 12:12:53 pm »

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”
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4850
    • Windsurf.me
Re: Upload error "memory size exhausted" / "Out of memory"
« Reply #1 on: September 15, 2013, 09:25:09 pm »

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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Upload error "memory size exhausted" / "Out of memory"
« Reply #2 on: September 16, 2013, 02:34:17 pm »

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).
Logged

Saber Rider

  • Coppermine newbie
  • Country: de
  • Offline Offline
  • Posts: 2
Re: Upload error "memory size exhausted" / "Out of memory"
« Reply #3 on: September 16, 2013, 06:58:24 pm »

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.


 
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Upload error "memory size exhausted" / "Out of memory"
« Reply #5 on: September 17, 2013, 09:29:15 am »

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).
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.