Memory exhaust

Last updated on
15 July 2018

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Ultimate Cron uses PHP shutdown handlers to clean up stale locks, if a job dies. However, in some cases, the shutdown handlers cannot be run, particularly if PHP memory exhausts in such a way, that there's not enough memory to run the shutdown handlers.

Ultimate Cron tries to solve this, by reserving an amount of memory in the beginning of the script execution.

The variable ultimate_cron_reserve_memory determines how much memory should be reserved (in bytes). It defaults to 1024 * 1024 * 2 (2MiB).

If the shutdown handler is not registered early enough on your system, it is possible to define it in settings.php instead. The name of the function is _ultimate_cron_out_of_memory_protection. Remember to implement the logic regarding the execution of the sub shutdown handlers. See the original function in ultimate_cron.module on what to do.

Help improve this page

Page status: No known problems

You can: