Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Why does not PHP free memory ?

$
0
0

Hi all,
I have a PHP script that connects to a db, retrieves some data and displays it to the user.
To get an idea of memory usage, I inserted some "echo memory_get_usage();" statements at different stages at the very beginning of the script, after the execution of the query, after the creation of an array gathering the data retrieved, just before the end of script, and finally just after the end of script.
As one may expect, the memory usage gets higher and higher as the script is running. However I do not undersand why the memory usage remains at its highest level at the last stage (after the end of the script), and does not get freed for further processing.
Thanks for shedding some light.
 


Viewing all articles
Browse latest Browse all 13200

Trending Articles