I try to run this command from inside the container
occ preview:generate-all
But after a while it throws the error:
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 77824 bytes) in /config/www/nextcloud/lib/private/legacy/OC_Image.php on line 533
Not sure where to start tbh.
Some other threads have mentioned setting apc.enable_cli=1, but it seems to been done, inside the file /etc/php81/conf.d/apcu.ini
I also get errors every time I try to upgrade Nextcloud. Times out every time. Maybe itâs related?
EDIT:
Tried to change
âmemcache.localâ => â\OC\Memcache\APCuâ,
Your system is low on memory. 512 MB is the minimum requirement, if you have installed too many apps, that can easily trigger such a problem. Also to consider, if you are at the minimum requirement, you need to adjust all your services to be as efficient as possible (database, webserver, âŚ), that can be tricky since the best configuration can depend on the use case.
Generating thumbnails takes up some resources:
There was a great blog post from NextcloudPi, I canât find it any more.
But⌠Nextcloud is running as a container on a host that has plenty of memory, and nowhere near using it all.
Is there some kind of memory limit for docker containers that Iâve never heard of maybe?
It would make sense to limit the resource usage, for other virtual machines you can configure that. I donât use docker, but your favorite search engine can probably help you.
@GD-Dal For my setup it was enough to slightly increase the memory limit for the command using php -d memory_limit=1024M occ .... With this you donât alter your container configuration and can fine tune the limit.
This comment is underrated! I searched quite some time, and for occ recognize clustering this was the best solution, to at least increate the batch size from 300 to 2000. Thanks!
The default PHP memory allocation is 512Mb under my docker container image (nextcloud:apache-stable).
This is not enough for all use cases - I hit problems with an inbound webdav connection from Photoprism - but the same PHP Error message.
Resolved the problem by setting the PHP_MEMORY_LIMIT to 1GB.
So added :
environment:
PHP_MEMORY_LIMIT: 1G
into my docker-compose yml file and restarted the container.