Reputation: 8860
I have become concerned about memory usage, so I decided to insert memory_get_usage() to check how much memory my page used. I ended up with almost 16MB in a page. But the weirdest thing is that I made a page JUST to test this out and it takes more than 15MB for a page with this single line of code:
Total memory used: <?php echo memory_get_usage(); ?>
That single line uses 15072216 of memory.
I've seen in other pages that it's normal to have some allocated memory initially... like 300k or so. But my allocated memory is about 40 times that. Is this memory usage between normal limits or should I contact the webhost admins? I'm using 000webhost.com with php 5.2.*
Upvotes: 1
Views: 689
Reputation: 14762
It's because PHP will always load all of it's extensions without knowing which one of them (if any) would be needed. So, the more extras you have installed, the more memory PHP will allocate each time a script is executed.
Upvotes: 4