XF 2.2 ErrorException: Fatal Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes)

Ludachris

Well-known member
After upgrading to 2.2 I'm getting the same error a few times per week, and that's with 1024M set for PHP memory_limit.

Code:
ErrorException: Fatal Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) src/XF/Language.php:246
Generated by: Unknown account May 12, 2021 at 10:01 AM
Stack trace
#0 [internal function]: XF::handleFatalError()
#1 {main}
Request state
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(63) "https://www.mysite.com/threads/98-gsx-clean-up-resto.xxxxx/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Most all the errors are occurring in threads, all referencing the Language.php file.
 

Lukas W.

Well-known member
The stack trace and error location are probably just masking errors. My guess would be that one of the jobs in the job queue is erroring and creating a huge error message that's exceeding the server resources. You could try to temporarily bump the memory limit to see if you can get past that limit and expose the actual error.
 

Mike

XenForo developer
Staff member
This is definitely a job in the queue, though unfortunately it's hard to know what (PHP's fatal errors are more or less useless unfortunately).

Roughly the only thing we can try to go by is the time of day/hour to see if that points to anything consistent which might attach it to a specific cron job. Is there a pattern there? (This one looks like it might be a job triggered at 10:00 or hourly at near the top of the hour; saying that, if your site is not busy this may not be accurate.) If not, it may be an ad hoc triggered job, which would unfortunately make it much more difficult to point to.
 

Ludachris

Well-known member
This is definitely a job in the queue, though unfortunately it's hard to know what (PHP's fatal errors are more or less useless unfortunately).

Roughly the only thing we can try to go by is the time of day/hour to see if that points to anything consistent which might attach it to a specific cron job. Is there a pattern there? (This one looks like it might be a job triggered at 10:00 or hourly at near the top of the hour; saying that, if your site is not busy this may not be accurate.) If not, it may be an ad hoc triggered job, which would unfortunately make it much more difficult to point to.
Well, I actually do see that all those errors are at the top of the hour, or within one minute of the hour. But they're all over the place throughout the day/night, so it must be a cron job running hourly or every few hours. Should I go and run each job manually to see if it errors out?
 

Mike

XenForo developer
Staff member
I think it's worth a shot, though it might not error if it's not consistent (and there might be some other variables). However, if we do manage to reproduce it then that would definitely help guide us.
 

Mike

XenForo developer
Staff member
I'm having the same problem, did you solve it?
My server has 1GB of memory and the limit is 128mb
That's not the same error and thus a different cause. "Out of memory" means that PHP couldn't allocate memory because the server/OS wouldn't give it any. In your examples, PHP couldn't get more than 2-4MB of memory before failing.

Your server very likely needs more memory or you need to make adjustments to change how memory is being allocated to the various services running on it.
 

ArcaGun

New member
That's not the same error and thus a different cause. "Out of memory" means that PHP couldn't allocate memory because the server/OS wouldn't give it any. In your examples, PHP couldn't get more than 2-4MB of memory before failing.

Your server very likely needs more memory or you need to make adjustments to change how memory is being allocated to the various services running on it.
I thought it was the same problem, sorry.
I will increase server memory
 
Top