Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) when Scheduled Purge of Finished TMGMT Translation Jobs

Created on 11 February 2019, almost 6 years ago
Updated 14 February 2024, 9 months ago

Scheduled Purge of Finished TMGMT Translation Jobs is running out of memory due to Multiple translation job deletes in tmgmt_cron() hook whenever Drupal Cron runs.Hence due to this issue the purge of finished tmgmt translation jobs fails and throws the following PHP Fatal error..

(Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 12288 bytes) in /var/www/ibm/docroot/core/lib/Drupal/Core/Database/Statement.php on line 59

🐛 Bug report
Status

Needs work

Version

1.0

Component

Core

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium dieterholvoet Brussels

    I'm running into the same issue, but when deleting a bunch of translation jobs in an own update hook. The problem is that Drupal\tmgmt\Entity\Job::postDelete() loads all job items at once in order to delete them, but if this was a long-running job with a lot of job items memory issues can arise even after deleting only one job.

    I propose loading and deleting the job items in chunks.

  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update over 1 year ago
    Not currently mergeable.
  • @dieterholvoet opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update over 1 year ago
    117 pass
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇨🇭Switzerland berdir Switzerland
  • 🇪🇸Spain carlosgm91 Alicante

    I had the same issue and finally i have used the same setting 'job_items_cron_limit' to use it also for the finished items, in case that the user has not enabled this setting, the limit will be 50 by default.
    Hope this will be heplful.

Production build 0.71.5 2024