nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
455 stars 57 forks source link

PHP OOM with preview:generate-all #262

Closed ghost closed 2 years ago

ghost commented 2 years ago

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 122880 bytes) in /var/www/html/lib/private/legacy/OC_Image.php on line 589 when running the generate-all function.

Steps to reproduce Run sudo docker exec -ti --user www-data nextcloud-app /var/www/html/occ preview:generate-all from command line. After running for several images a memory limit is hit. Attempting to restart the script hits the limit in the same place each time.

Expected behaviour You shouldn't run out of memory

Actual behaviour You run out of memory

Server configuration Operating system: Official nextcloud docker image

Web server: apache - built into docker image base

Database: mariadb

PHP version: 8.0

Nextcloud version: 22.2.3

Updated from an older Nextcloud/ownCloud or fresh install: Fresh install of 22.2.3

Where did you install Nextcloud from: dockerhub

ghost commented 2 years ago

I followed this: #1014 to manually lift the PHP limit, which allows overriding the default Docker PHP configuration for Nextcloud (as per the readme).

I set the limit to 10 GB and monitored in HTOP. It would peak at around 2.5 GB usage and then fall back to 1.15 GB.

This modification has "fixed" the issue for me, although I'd suggest adding it in as a requirement of use as opposed to a note in an FAQ section.