Forum Moderators: coopster

Message Too Old, No Replies

Finding out how much RAM is used

How to go about it?

         

garyr_h

7:16 pm on May 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yesterday I was 'told', actually, found out by visiting my own site.... that my hosting has been suspended because of RAM overuse. I have been using pretty much the same scripts for over a year, with one extra 'tool' I wrote two months ago and has been getting around 100-200 uses/day sometimes more.

I test out the scripts on my own server before putting them directly onto my website, I never really paid attention to the RAM though, as I didn't think they were all that heavy.

So after yesterday, I have been trying to figure out what script is causing the problem. I have checked out the year old scripts and the one I created two months ago, however, from all I can tell they only use 2MB extra than anything else I have, nothing compared to the 200-400MB they claim.

The only way I am checking is by viewing windows task manager/performance tab.

So my question is, is there a better way to go about figuring how much RAM is used? Is there a program I can use to sniff out this sort of thing, or is there just some additional 'php RAM knowledge' I need to pick up? Or am I just getting the run-around, "Pay us more money" from my host?

Little_G

4:52 pm on May 16, 2006 (gmt 0)

10+ Year Member



Hi,

PHP has a built in function (memory_get_usage) [uk.php.net] to tell you how much ram the script is using.
You can also limit the amount of memory usage via .htaccess:

php_value memory_limit 8M

Andrew