473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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).

Aug 23 '07 #1
4 4287
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.)
Aug 23 '07 #2
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

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.
js*******@attglobal.net
==================
Aug 23 '07 #3

Jerry Stuckle;88408 Wrote:
>
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).

Aug 23 '07 #4
FFMG wrote:
Jerry Stuckle;88408 Wrote:
>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.
js*******@attglobal.net
==================
Aug 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: lawrence | last post by:
I'm not sure how this is normally done, on a large site, perhaps one running Phorum. Occassionally a thread will have hundreds of entries, perhaps a meg or two worth of data. You won't necessarily...
3
by: Guy | last post by:
Hi It might take me a little time to explain this but here goes. Firstly I'm not using the latest upto date python releases so my first plan is to try more upto date rels of python and win32...
9
by: Birgit Rahm | last post by:
Hello newsgroup, I am a beginner, so I am asking maybe immoderate questions. I want to delete a variable, after filling it with complex objects. How should I do it? e.g. AAA = AAA = Can I...
2
by: Lars Eighner | last post by:
What does this me? /usr/ports/lang/php5-cli/work/php-5.0.5/main/streams/streams.c(1209) : Freeing 0x083AC564 (1 bytes), script=/home/webmaster/allphp/main.php...
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
14
by: Piotrek | last post by:
Hi all. I have a web app, in which I use frames. My main frameset consists of three inner frames. When some button is pressed in frame A, then content of frame B is reloaded. I am using such...
0
by: kiran kumar | last post by:
Hi All, I am working on embedded python on C these days. I feel there is a memory leakage in this code. I have used our own memory pool and all the python code will use the heap from this memory...
9
by: Bruno Barberi Gnecco | last post by:
I'm using PHP to run a CLI application. It's a script run by cron that parses some HTML files (with DOM XML), and I ended up using PHP to integrate with the rest of the code that already runs the...
11
by: dhtml | last post by:
(originally mis-posted on m.p.s.jscript...) I've just closed all windows in Firefox and its using 244MB of memory. I have no idea why. I had GMail open, a page from unicode, the CLJ FAQ. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.