Bug #70341 [Com]: Weird behaviour of memory_get and peak_usage

From: Date: Thu, 27 Aug 2015 19:16:47 +0000
Subject: Bug #70341 [Com]: Weird behaviour of memory_get and peak_usage
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195564@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70341&edit=1 ID: 70341 Comment by: quantuumsnot at gmail dot com Reported by: quantuumsnot at gmail dot com Summary: Weird behaviour of memory_get and peak_usage Status: Not a bug Type: Bug Package: *General Issues Operating System: windows 7 x64 PHP Version: 7.0.0RC1 Assigned To: cmb Block user comment: N Private report: N New Comment: Should I show my script for monitoring how much memory each function uses? Results are stored in SQLite database http://wikisend.com/download/556368/metrics.db [URL=http://wikisend.com/download/556368/metrics.db]metrics.db[/URL] Previous Comments: ------------------------------------------------------------------------ [2015-08-27 14:49:32] cmb@php.net Yes, that is exactly what is reported on <https://3v4l.org/COXWa> for PHP 7. However, 2097152 / 1024 / 1024 = 2 ------------------------------------------------------------------------ [2015-08-27 14:40:35] quantuumsnot at gmail dot com UBench returns this on my setup (nothing changed): 2.00Mb 2097152 2.000Mb 2.00Mb ------------------------------------------------------------------------ [2015-08-27 10:17:54] cmb@php.net You have claimed > The fix is to use at line #1 memory_get_usage(false) which > returns 40-50 times!!! bigger memory usage (for example > 1.6-1.8MB instead of 40-45KB) and later corrected > using false gives me 0 bytes, using true gives me a rly big > difference in bytes used However, <https://3v4l.org/COXWa> doesn't show this behavior. ------------------------------------------------------------------------ [2015-08-27 01:44:27] quantuumsnot at gmail dot com https://3v4l.org/COXWa ------------------------------------------------------------------------ [2015-08-26 20:50:47] cmb@php.net > Tested it on 3v4l.org and the results are the same, 5.5.0-5.6.12 always win Can you please post a link to the 3v4l.org test? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=70341 -- Edit this bug report at https://bugs.php.net/bug.php?id=70341&edit=1

« previous php.bugs (#195564) next »