diff options
author | Josh <josh.t.richards@gmail.com> | 2024-05-27 09:19:48 -0400 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-06-11 14:20:57 +0200 |
commit | 8ee070cce5491a8f6a93354f0239d9747c2635ed (patch) | |
tree | e67ea189b665bb03e60bf957ebf7412f0198ab35 /cron.php | |
parent | 81e90ae592ffb48e4420e235729494ebc01b44b4 (diff) | |
download | nextcloud-server-8ee070cce5491a8f6a93354f0239d9747c2635ed.tar.gz nextcloud-server-8ee070cce5491a8f6a93354f0239d9747c2635ed.zip |
fix(cron): Log excess memory usage at debug and info levels
Signed-off-by: Josh <josh.t.richards@gmail.com>
Diffstat (limited to 'cron.php')
-rw-r--r-- | cron.php | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -163,10 +163,10 @@ Options: $memoryAfter = memory_get_usage(); $memoryPeakAfter = memory_get_peak_usage(); - if ($memoryAfter - $memoryBefore > 10_000_000) { - $logger->warning('Used memory grew by more than 10 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')', ['app' => 'cron']); + if ($memoryAfter - $memoryBefore > 50_000_000) { + $logger->warning('Used memory grew by more than 50 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')', ['app' => 'cron']); } - if ($memoryPeakAfter > 300_000_000) { + if ($memoryPeakAfter > 300_000_000 && $memoryPeakBefore <= 300_000_000) { $logger->warning('Cron job used more than 300 MB of ram after executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryPeakAfter) . ' (before: ' . Util::humanFileSize($memoryPeakBefore) . ')', ['app' => 'cron']); } |