XF 2.3 Fatal Error: Allowed memory size

politsim

Member
Hello everyone. Maybe someone can tell me where to dig.

Recently, errors like
Fatal Error: Out of memory (allocated 112578560 bytes) (tried to allocate 20480 bytes)

The error appears on the main forum page at random times.
At the same time, all limits have long been increased:
[x******.info]_1740850934303.webp

When communicating with the hosting provider, I received the following answer:

At the specified time, PHP processes occupied more than 900 MB of RAM:
Upload all images and files only to our server!
For the Host tariff plan, it is impossible to use more than 1 GB of RAM per process.
I want to add that it is generally strange that at the moment of observing the problem (for example now):
Fatal error: Out of memory (allocated 113246208 bytes) (tried to allocate 20480 bytes) in /var/www/u0513784/data/www/politsim.ru/src/addons/ThemeHouse/Nodes/Repository/NodeStyling.php on line 178
Only 3 PHP handlers are running under your user:

u0513784 599 2.0 0.0 615780 88532 ? S 18:45 0:35 /opt/php/8.3/bin/php-cgi
u0513784 17896 3.0 0.0 1471896 86076 ? S 18:45 0:51 /opt/php/8.3/bin/php-cgi
u0513784 20948 1.7 0.0 516984 54564 ? S 19:12 0:01 /opt/php/8.3/bin/php-cgi

Within the virtual hosting, you can launch up to 8 handlers, each of which can consume up to 1 GB of RAM.
In your case, it turns out that the site scripts create 1 PHP process that runs into the 1 GB memory limit, while you still have available resources. I recommend discussing this issue with the site developer or on thematic forums, perhaps the problem can be solved by optimizing how the site uses hosting resources.

Maybe someone can tell me where to look for what?
 
We have a very large database and this happened to us too..
Ended up setting the PHP max memory to 1.5gb... and this works longterm.

Also had to increase the maximum size mysql in-memory table size because our sessions table, which is an in-memory table, was busting past it's limits.
 
What is your hosting and are you running at Shared or VPS, Dedicated server?

What is your server specification?
Hosting Russian Reg.ru
If I understand correctly, then shared

According to the characteristics, if I understood correctly:
54 GB SSD
27 GB for files and 27 GB for DB
100 CP
2.2 GHz processor
 
We have a very large database and this happened to us too..
Ended up setting the PHP max memory to 1.5gb... and this works longterm.

Also had to increase the maximum size mysql in-memory table size because our sessions table, which is an in-memory table, was busting past it's limits.
Yes, but our database is not that big.
 
Hosting Russian Reg.ru
If I understand correctly, then shared

According to the characteristics, if I understood correctly:
54 GB SSD
27 GB for files and 27 GB for DB
100 CP
2.2 GHz processor
Sounds like you are currently running on a Shared server. that is issue. I recommend upgrading to a VPS server (KVM). Or contact support via hosting to check your server what's going on
 
Odd. I cannot access the Notices panel in the admin and I get a 500 error. The log tells me that I've got a memory size error and my increasing memory_limit = 2048M still yields the same error. I'm on a VPS. Trying to troubleshoot this.
 
Still negative. The error is below and it's only the Communications > Notices feature in the admin panel.

Code:
 [proxy_fcgi:error] [pid 1486433:tid 1486440] [client x.x.x.x:64943] AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 12288 bytes) in /home/mysite/public_html/src/XF/Db/Mysqli/Statement.php on line 134; PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /home/mysite/public_html/src/XF/Error.php on line 1', referer: https://www.mysite.com/admin.php?users/alert
 
Last edited:
On topic. So far, adding a block for bingbot/2.0 seems to have helped. Fatal errors remain, but much less frequently (previously several times a day, now a couple of times a week).
 
Back
Top Bottom