Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 23rd, 2007, 06:55 AM
FFMG
Guest
 
Posts: n/a
Default How much memory does my script use?


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


--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=19636

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

  #2  
Old August 23rd, 2007, 10:35 AM
Erwin Moller
Guest
 
Posts: n/a
Default Re: How much memory does my script use?

FFMG wrote:
Quote:
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.)
  #3  
Old August 23rd, 2007, 02:05 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: How much memory does my script use?

FFMG wrote:
Quote:
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
>
>
Are you talking about real memory or virtual memory? How much of each
do you have? And is it PHP and/or MySQL using the memory or something
else? Is this average or peak?

What are you doing in your scripts which might be memory intensive? I.e.
are you using large arrays? Graphic manipulation? Reading large files
into memory? Something else?

I regularly run 75%+ of real memory on my VPS's and they runs fine. But
I also have the systems tuned to run that way.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  #4  
Old August 23rd, 2007, 03:35 PM
FFMG
Guest
 
Posts: n/a
Default Re: How much memory does my script use?


Jerry Stuckle;88408 Wrote:
Quote:
>
Are you talking about real memory or virtual memory? How much of each
do you have? And is it PHP and/or MySQL using the memory or something
else? Is this average or peak?
>
What are you doing in your scripts which might be memory intensive?
I.e.
are you using large arrays? Graphic manipulation? Reading large
files
into memory? Something else?
>
I regularly run 75%+ of real memory on my VPS's and they runs fine.
But
I also have the systems tuned to run that way.
>
Well, everything runs fine except for the WHM updates, every nights it
tries to update the system but for the life of me I cannot see what
could take so much memory, (maybe the unpacking?).

I am a windows user but my VPS is unix, so I am not sure if I am using
Virtual or real memory. And if I should allocate virtual memory or
not.
I am guessing that if I could allocate some virtual memory then the WHM
updates could run without a hitch.

The reason I ask is, last week the system went down and since then the
Hosting co is saying that it was my fault, (but I had changed nothing
in my scripts).
After complaining that they had screwed up the system and not me they
are now saying that I am using too much memory and the Updates are
crashing every morning.

I have disabled the updates for now, but i need to resolve the issue.

What are the unix commands to
- Get the virtual memory
- Get the real memory
- Set the virtual memory, (and what do you suggest it should be?)

Thanks

FFMG


--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=19636

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

  #5  
Old August 23rd, 2007, 04:55 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: How much memory does my script use?

FFMG wrote:
Quote:
Jerry Stuckle;88408 Wrote:
Quote:
>Are you talking about real memory or virtual memory? How much of each
>do you have? And is it PHP and/or MySQL using the memory or something
>else? Is this average or peak?
>>
>What are you doing in your scripts which might be memory intensive?
>I.e.
>are you using large arrays? Graphic manipulation? Reading large
>files
>into memory? Something else?
>>
>I regularly run 75%+ of real memory on my VPS's and they runs fine.
>But
>I also have the systems tuned to run that way.
>>
>
Well, everything runs fine except for the WHM updates, every nights it
tries to update the system but for the life of me I cannot see what
could take so much memory, (maybe the unpacking?).
>
I am a windows user but my VPS is unix, so I am not sure if I am using
Virtual or real memory. And if I should allocate virtual memory or
not.
I am guessing that if I could allocate some virtual memory then the WHM
updates could run without a hitch.
>
The reason I ask is, last week the system went down and since then the
Hosting co is saying that it was my fault, (but I had changed nothing
in my scripts).
After complaining that they had screwed up the system and not me they
are now saying that I am using too much memory and the Updates are
crashing every morning.
>
I have disabled the updates for now, but i need to resolve the issue.
>
What are the unix commands to
- Get the virtual memory
- Get the real memory
- Set the virtual memory, (and what do you suggest it should be?)
>
Thanks
>
FFMG
>
>
You need to ask these questions in a Unix/Linux admin group.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles