Memory leak in 7.x json_decode()?
<?php
echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL;
$json = json_decode(file_get_contents('http://zaremedia.com/big.json'));
echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL;
unset($json);
echo memory_get_usage(false) . ' : ' .memory_get_usage(true) . PHP_EOL;
// Running on 7.0 and 7.1
349608 : 2097152
27245512 : 29360128
375552 : 29360128
// Running on 5.6
221136 : 262144
31577064 : 35913728
420104 : 8650752
I am very glad to read your informative blog...thanks a lot for your valuable sharing
ReplyDeleteyou can also visit here php training in delhi