From 8479dc56904506627e8f9bc2923e810bd18aa8d7 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 18 Apr 2020 14:54:38 -0400 Subject: [PATCH] Record total memory usage in debug messages. --- framework/kernel.php | 9 +++++++++ includes/init.php | 1 + 2 files changed, 10 insertions(+) diff --git a/framework/kernel.php b/framework/kernel.php index 132506b..8c5513f 100644 --- a/framework/kernel.php +++ b/framework/kernel.php @@ -158,6 +158,8 @@ define('REQ_NO', 0); * ISSO_MT_START - Define the microtime() value at the top of your * script and this will calculate the total execution * time +* ISSO_MEMORY_START - The result of memory_get_usage(true) at the start of +* the script. * SVN - Place SVN keywords (like $Id) to display the information on output * * @author Blue Static @@ -1209,6 +1211,13 @@ class ISSO $debug .= "\n\t
  • Total Execution Time: " . round($this->modules['functions']->fetch_microtime_diff(ISSO_MT_START), 10) . "
  • "; } + // total memory usage KB + if (defined('ISSO_MEMORY_START')) + { + $end = memory_get_usage(true); + $debug .= "\n\t
  • Total Memory Usage: " . ($end - ISSO_MEMORY_USAGE)/1024 . " KB
  • "; + } + // debug notices $debug .= "\n\t
  • \n\t\t