My PHP application is a little slower, and at the moment it is not very efficient. My whole server goes very often, and I think this application is to blame. I thought I would monitor the memory usage and check how much I have limited:
echo 'Memory in use: ' . memory_get_usage() . ' ('. memory_get_usage()/1024 .'M) <br>'; echo 'Peak usage: ' . memory_get_peak_usage() . ' ('. memory_get_peak_usage()/1024 .'M) <br>'; echo 'Memory limit: ' . ini_get('memory_limit') . '<br>';
This shows the following:
Memory in use: 629632 (614.921875M) Peak usage: 635696 (620.796875M) Memory limit: 128M
How could this be? Is WAY memory usage larger than memory limit? Either something is really broken, or I donβt understand how the setting memory_limit (or memory_get_usage() ) works
Thanks to everyone.
source share