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.
 
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.
 
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.
 
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?
 
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.
 
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.
 
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
 
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.
any solution on this
 
I'm also getting regular errors about submitting sitemaps to Bing on multiple sites. Can't find any solutions so the errors are just stacking up at this point.
For Bing you can change the sitemap URL in xml sitemap options to this.

https://www.bing.com/webmaster/ping.aspx?siteMap={$url}

This make them go away. For other error you just need to configure your server properly.

1650539167284.png
 
For other error you just need to configure your server properly.
LOL, yeah, if it were only that simple, especially for larger forums. The term "properly" can be a moving target with software like this. Increase the memory limit on the server too much and you cause other issues. I've always followed all the XF suggestions for server settings and it doesn't always mean there won't be errors, even when you have more than enough hardware to power the site. There will always be variables that you can't anticipate that will cause errors. I've paid "experts" to help out, it never really solves the problem completely.
 
Last edited:
LOL, yeah, if it were only that simple, especially for larger forums. The term "properly" can be a moving target with software like this. Increase the memory limit on the server too much and you cause other issues. I've always followed all the XF suggestions for server settings and it doesn't always mean there won't be errors, even when you have more than enough hardware to power the site. There will always be variables that you can't anticipate that will cause errors. I've paid "experts" to help out, it never really solves the problem completely.I
How big is your forum? just curious. Can I see ?
 
Back
Top Bottom