Answers.Body: <p>I once had a similar thing: The system was running with WordPress, and there was a certain WordPress plugin installed, that was poorly programmed (in that case, the WP plugin checked if memory is at least 128MB or so by only checking if it starts with a number &gt; 128 - otherwise  the WordPress plugin overwrote the PHP memory setting with 128MB...). Your current issue might have a similar root cause.</p>
  <p>You could use some WordPress plugin that shows you your &quot;real&quot; memory settings, and it might come out, that you really don't have more than 128MB available... What normally is not a problem, but scheduled jobs often need more memory.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-06T11:03:47.287Z
Answers.LastActivityDate: 2024-09-06T11:03:47.287Z
Answers.UserDisplayName: Detlev Sieber
Body: <p>Cron has stopped running and an unexpected  memory issue has popped up in logs</p>
  <blockquote>
  <p>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
  to allocate 1622016 bytes) in
  /wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php on
  line 411</p>
  <p>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
  to allocate 69632 bytes) in
  /wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Cache.php on line 226</p>
  </blockquote>
  <p>Happened after switching to php 8.3 (2g memory allocated already)  &amp; <strong>CiviCRM 5.74.4</strong>.</p>
  <p>Switch back to php 8.1 &amp; 1G memory made cron running again.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-05T02:56:11.073Z
Comments.Text: What CMS are you using?
Comments.UserDisplayName: Detlev Sieber
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-05T10:08:18.643Z
Comments.Text: @DetlevSieber Wordpress - the latest.
Comments.UserDisplayName: yurg
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-08T19:36:27.920Z
Comments.Text: Same issue on my side while running cron on Drupal:
  
  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36864 bytes) in /var/www/vhosts/domain.com/httpdocs/sites/all/modules/civicrm/packages/Smarty/Smarty_Compiler.class.php on line 359`
Comments.UserDisplayName: Guillaume Sorel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-09T11:41:06.427Z
Comments.Text: @GuillaumeSorel which PHP is it? There are a lot of reasons of memory issues, mine is narrowed down be PHP8.3-related and,perhaps,some code incompatibility - not sure if it is Civi or its extension or something at wordpress side.
Comments.UserDisplayName: yurg
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-10T12:17:15.590Z
Comments.Text: I think it was 8.3.9 or 8.3.10
Comments.UserDisplayName: Guillaume Sorel
Tags: <php><cron><memory>
Title: PHP 8.3 CiviCRM 5.74.4 "allowed memory size"
ThreadText: # PHP 8.3 CiviCRM 5.74.4 "allowed memory size"
  
  (Asked by: username_0 on 2024-08-16)
  
  Cron has stopped running and an unexpected memory issue has popped up in logs
  
  > Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
  > to allocate 1622016 bytes) in
  > /wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php on
  > line 411
  >
  > Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
  > to allocate 69632 bytes) in
  > /wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Cache.php on line 226
  
  Happened after switching to php 8.3 (2g memory allocated already) & **CiviCRM 5.74.4**.
  
  Switch back to php 8.1 & 1G memory made cron running again.
  
  **Tags:** php, cron, memory
  
  > **Comments:**
  > **username_1**: What CMS are you using?  
  > **username_0**: @DetlevSieber Wordpress - the latest.  
  > **username_2**: Same issue on my side while running cron on Drupal:  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36864 bytes) in /var/www/vhosts/domain.com/httpdocs/sites/all/modules/civicrm/packages/Smarty/Smarty_Compiler.class.php on line 359`  
  > **username_0**: @GuillaumeSorel which PHP is it? There are a lot of reasons of memory issues, mine is narrowed down be PHP8.3-related and,perhaps,some code incompatibility - not sure if it is Civi or its extension or something at wordpress side.  
  > **username_2**: I think it was 8.3.9 or 8.3.10  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-09-06. Score: 1
  
  I once had a similar thing: The system was running with WordPress, and there was a certain WordPress plugin installed, that was poorly programmed (in that case, the WP plugin checked if memory is at least 128MB or so by only checking if it starts with a number > 128 - otherwise the WordPress plugin overwrote the PHP memory setting with 128MB...). Your current issue might have a similar root cause.
  
  You could use some WordPress plugin that shows you your "real" memory settings, and it might come out, that you really don't have more than 128MB available... What normally is not a problem, but scheduled jobs often need more memory.
  
  
  ---
  
  