Fixed Improve error reporting when OOM occurs

Xon

Well-known member
Affected version
2.2.6
Currently XenForo can essentially hard falls over when an OOM error occurs, and fails to log OOM errors.

There are strategies to work-around (discussed here);
  • Pre-reserve a chunk of memory at startup
  • In the shutdown handler;
    • Try call ini_set('memory_limit') with a higher limit.
    • Release the reserve and/or clear various caches before any operation which could allocate. (including other function calls!)
This doesn't work in all cases, but it would work in a large number of them.

Frameworks like laravel also implement some of these workaround.

Works; OOM due to allocation; https://3v4l.org/Xuun2
Some what works; OOM due to stack exhaustion; https://3v4l.org/K2Uq4
 
Last edited:
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.8).

Change log:
Reserve some memory for error reporting
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom