Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

require_once __DIR__ . '/lib/versioncheck.php';
$memoryBefore = memory_get_usage();

use OC\ServiceUnavailableException;
use OC\User\LoginException;
Expand Down Expand Up @@ -104,4 +105,10 @@
throw $ex;
}
OC_Template::printExceptionErrorPage($ex, 500);
} finally {
$memoryAfter = memory_get_usage();
if ($memoryAfter - $memoryBefore > 400_000_000) {
$message = 'Used memory was more than 400 MB: ' . \OCP\Util::humanFileSize($memoryAfter - $memoryBefore);
\OCP\Server::get(LoggerInterface::class)->warning($message);
}
}
7 changes: 7 additions & 0 deletions ocs/v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

require_once __DIR__ . '/../lib/versioncheck.php';
$memoryBefore = memory_get_usage();
require_once __DIR__ . '/../lib/base.php';

use OC\OCS\ApiHelper;
Expand Down Expand Up @@ -70,4 +71,10 @@
// Just to be save
}
ApiHelper::respond(OCSController::RESPOND_SERVER_ERROR, $txt);
} finally {
$memoryAfter = memory_get_usage();
if ($memoryAfter - $memoryBefore > 400_000_000) {
$message = 'Used memory was more than 400 MB: ' . \OCP\Util::humanFileSize($memoryAfter - $memoryBefore);
\OCP\Server::get(LoggerInterface::class)->warning($message);
}
}