You are here: Re: How much memory does my script use? « PHP Programming Language « IT news, forums, messages
Re: How much memory does my script use?

Posted by Erwin Moller on 08/23/07 09:27

FFMG wrote:
> Hi,
>
> My Hosting company is saying that I am using too much memory on the VPS
> and that I should upgrade.
>
> I am currently running at 65%-75%, (according to WHM).
>
> It does seem a bit high, but I cannot see what could be using a lot of
> memory. I have MySQL 5 and and php 4.4.
> Is there any PHP code that I could use to 'check' how much memory a
> script is using to run so that I could flag the problem ones?
>
> How would you identify what process is taking large amount of memory?
>
> FFMG
>
>

Hi,

Have a look at memory_get_usage() at php.net.
You could try to use it to get an idea of what parts of your script take
up what amount of memory.
Just place it at strategically placed points in your script, like before
calling a heavy function, and during the function, and when it returns.
Since we don't know your script, you'll have to identify the subject
actions in the script yourself.

Hope that helps.
Good luck.

Regards,
Erwin Moller

PS: Tip: If you have a question like this, first go to www.php.net and
type it in the searchfield. (If you type 'memory' there you find this
function.)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация