From cbc774723a14b523e54552860e9cf93a85eb7869 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sun, 1 Dec 2013 08:34:17 +0000 Subject: add info memory --- phpdbg_info.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'phpdbg_info.c') diff --git a/phpdbg_info.c b/phpdbg_info.c index f44d19211a..12852fc38d 100644 --- a/phpdbg_info.c +++ b/phpdbg_info.c @@ -225,6 +225,26 @@ PHPDBG_INFO(literal) /* {{{ */ return SUCCESS; } /* }}} */ +PHPDBG_INFO(memory) /* {{{ */ +{ + if (is_zend_mm(TSRMLS_C)) { + phpdbg_notice("Memory Manager Information"); + phpdbg_notice("Current"); + phpdbg_writeln("|-------> Used:\t%.3f kB", + (float) (zend_memory_usage(0 TSRMLS_CC)/1024)); + phpdbg_writeln("|-------> Real:\t%.3f kB", + (float) (zend_memory_usage(1 TSRMLS_CC)/1024)); + phpdbg_notice("Peak"); + phpdbg_writeln("|-------> Used:\t%.3f kB", + (float) (zend_memory_peak_usage(0 TSRMLS_CC)/1024)); + phpdbg_writeln("|-------> Real:\t%.3f kB", + (float) (zend_memory_peak_usage(1 TSRMLS_CC)/1024)); + } else { + phpdbg_error("Memory Manager Disabled !"); + } + return SUCCESS; +} /* }}} */ + static inline void phpdbg_print_class_name(zend_class_entry **ce TSRMLS_DC) /* {{{ */ { phpdbg_write( -- cgit v1.2.1