Defining the PHP memory_limit

Olivier Paroz edited this page Apr 15, 2016 · 5 revisions

If you get a message like this one,

"Allowed memory size of 536870912 bytes exhausted (tried to allocate 13743895345 bytes) at DOCROOT/lib/private/image.php#xxx"

it is likely that you have a PHP memory_limit set too low for your needs. Image processing requires a lot of memory.

Here is a quick Bytes to MegaBytes conversion table to make more sense out of these large numbers

Bytes MegaBytes
8388608 8
16777216 16
33554432 32
67108864 64
134217728 128
268435456 256
536870912 512
1073741824 1024

Understanding your requirements

In order to understand what your memory requirements might be, you should visit this website which lets you input an image's dimensions and the target size and will calculate how much memory the operation will require:

Some examples

Those are the memory requirements when resizing to the default 2048x2048

MegaPixels MegaBytes
14.1 99
12.2 87
8.7 66

All those numbers are on top of what the process is already using for its normal operations. Usually 30-60MB

Adjusting the limit

Please refer to the ownCloud documentation to understand where you should modify the PHP memory_limit setting:

Note: The syntax is different depending on where you make the modification.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.