We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b6401f commit 8aa28ecCopy full SHA for 8aa28ec
1 file changed
lib/base.php
@@ -18,6 +18,7 @@
18
use OCP\Server;
19
use OCP\Share;
20
use OCP\User\Events\UserChangedEvent;
21
+use OCP\Util;
22
use Psr\Log\LoggerInterface;
23
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
24
use function OCP\Log\logger;
@@ -828,6 +829,15 @@ public static function init(): void {
828
829
register_shutdown_function(function () use ($eventLogger) {
830
$eventLogger->end('request');
831
});
832
+
833
+ register_shutdown_function(function () {
834
+ $memoryPeak = memory_get_peak_usage();
835
+ if ($memoryPeak > 300_000_000) {
836
+ $message = 'Request used more than 300 MB of ram: ' . Util::humanFileSize($memoryPeak);
837
+ $logger = \OCP\Server::get(LoggerInterface::class);
838
+ $logger->warning($message, ['app' => 'core']);
839
+ }
840
+ });
841
}
842
843
/**
0 commit comments