Jump to content

php mem usage


sneskid

Recommended Posts

I ran this string as a shell command: $cmd = 'ps -o%mem,rss,pid | grep ' . getmypid();

It shows the mem usage. I ran it in a bare script and it showed it's using just over 7000 kb of mem, 0.7% or total memory.
I guess the server has 1gig memory.

This seemed like a large chunk of memory for a bare bone script to be using, so I made a huge array(range(1, 10000)) to see if the mem usage jumped, just to make sure this was the right process. It spiked up by 800kb.

The question I have... isn't 7 megs rather much for a bare script process to take up??

How does php run each script? Does it start them as their own process, or as a thread from the main php process, or does what I just typed make me sound like a total noob.

Thanks for any insight, feel free to include extra details, nerd talk is my friend.
Link to comment
https://forums.phpfreaks.com/topic/25383-php-mem-usage/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.