Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 194749664 bytes) at / ..lib/private/AppFramework/Middleware/CompressionMiddleware.php#70

Hi,

I am running my own NC on a web hosted server (PHP8.3) and did some updates in the last days to finally arrive at the latest version now (30.0.1).

I managed to get rid of mostly all of the warnings in the admin overview, but suddenly I receive these errors in the log:

Allowed memory size of 536870912 bytes exhausted (tried to allocate 194749664 bytes) at / …lib/private/AppFramework/Middleware/CompressionMiddleware.php#70

Hello @gabs0110 welcome to the Nextcloud community :handshake:

You started a topic in support category. Unfortunately you ignored the template and a lot of information to help you is missing. Please add all necessary information like Nextcloud version, webserver type and version, os version, related log file content. Use the support template. Without additional information the community members cannot help you.

Your specific topic has been discussed many times, please use search and report what you tried and where you fail

Regards,
wwe

1 Like

I have that too on NC 31.0.1.

The message comes from the Nextcloud cronjob.

In my case the error message comes because PHP was not allocated enough memory and therefore a large JPG i just uploaded could not be processed.

You have to increase some memory value in php.ini, but I don’t know exactly which one right now.

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted
(tried to allocate 504336048 bytes)
in /var/www/clients/client1/web4/web/lib/private/Files/Storage/Local.php
on line 294

Thank you, wwe, for your answer.
I tried to give as much infortmation as possible in my initial post, but did somem further research to find out more:

The Basics
Nextcloud Server version: 31.0.1
Operating system and version: Linux version 4.18.0-553.16.1.lve.1.el8.x86_64
Web server and version: Apache - version unknown (how can I find this out on a webhosted server; I have SSH access to terminal and tried a lot but did not succeed)
Reverse proxy and version: unknown
PHP version: 8.3
Is this the first time you’ve seen this error? (Yes / No): YES
When did this problem seem to first start?: 18.3.2025
Installation method (e.g. AIO, NCP, Bare Metal/Archive, etc.): unknown
Are you using Cloudflare, mod_security, or similar? (Yes / No): unknown

Apparantly something strange happened over night.
When I now check the logging page (…/index.php/settings/admin/logging) there is only one error listed, all other entries disappeared.

The one error I can see now is:
“Capabilities of OCA\CloudFederationAPI\Capabilities took 1 seconds to generate.”

Thank you for your help.

Try

memory_limit = 1024M

in

/etc/php/8.3/cli/php.ini

and

/etc/php/8.3/fpm/php.ini

and restart.

Thanks, but - as explained - my NC runs on a web hosted server and I don’t have access to the php.ini

Memory limit ist set to 512MB already by my web hosting company.

Best,
Gabriel

If the error message is caused by the cronjob, you can set the parameter yourself:

If this does not help, your web hoster can edit the parameter for your vHost.