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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.