Allowed memory size of x bytes exhausted

I cannot delete any files from my NC installation any more - neither on my clients via the nextcloud client software nor via the webinterface while logged into my account.
All tries result in a line within the apache error.log

[Fri Dec 23 10:04:55.056216 2016] [:error] [pid 32216:tid 140387708495616] [client :59562] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 77 bytes) in /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 104

I tried increasing the memory limit in .htaccess and my php.ini files but the result is the same. The error message just shows the inrceased memory size.

My system:
os: gentoo
webserver: apache 2.4.25
php 5.6.28
nc: 11.0.0 upgraded from 10.0.2

within the last nc upgrade i also moved my data directory outside the webserver path as it is recommended.

Can you verify the memory limit with a testpage, just place a test.php into /var/www with

<?php phpinfo(); ?>

And see what memory-limit is shown. There should also be the path to your php.ini (normally there are different php.ini’s on a system. Did you restart apache after the changes? How much total memory does your system have?

Thanks for your reply.

It doesnt matter what i put into my php.ini files (yes i adjusted them all). Yes, i restarted Apache after each adjustment and the error message just shows the value i put into there. So the adjustments work.

I tried 512M and 1024M and 2048M - but that cannot be the reason for this because i host another NC 11 instance on a different Server and there it works just fine with 512M.

Both Servers have 4096MB of RAM.

And the error message did change as well to the value you set in your php.ini (Allowed memory size of xxx bytes exhausted)?

yes, the error message changes.

So you really need more than 2048M of memory. This is a lot, but the usage depends a lot on the number of files, the used apps and the overall load of the server. Do you use system cronjobs? This reduces the load on normal visits. If you delete large subfolder, there might be a lot of queries and it could be better, to clean out some larger subfolders separately (should only be the case if you have several thousand files in this folder).

I did as you suggested and increased the ramsize of the vm to 8GB and the Memory Limit to 2048M - it is working now but deleting files is still slow as hell - even while being logged into the webif.

I’m also having the same problem. In my case I think what started to trigger this was usage of a image thumbnail generator (because I was trying to speed up gallery load times).

2 Likes