Operating System - HP-UX
1832604 Members
2436 Online
110043 Solutions
New Discussion

Re: Some Questions about Memory Usage

 
Daniel Schneider_3
Frequent Advisor

Some Questions about Memory Usage

Hi all,

it seems, that I'm running out of memory on a 2-Way HP9000 L2000.
My Machine has 2Gig of Physical Memory, and there is running Oracle 9i.
In Oracle Enterprise Manager, there is shown a Max SGA-Size of 705,464MB. If possible, I want to increase this size, but at the Moment, it seems, that I must decrease it.

Some facts of the machine, are written in a attached document.

I need some explanation, to understand. Can you give me some Answers to the following questions?:

A) My Machine has 2Gig of real Memory. I set the kernel parameter shmmax to 1,6Gig. Is this amount hard allocatet to shared memory, and can not be used by other processes, or ist this the maximum value, which the system allows to be allocated from shared mem?

B) is the sum of the column segsize in 'ipcs -ma' the whole actual used and allocated shared memory, or is there unused, but allocated shared memory, which can not be used by system processes?

C) How can I determine, what processes use the Memory at the moment? Is it the sum of of all tasks in column size in 'top'?

D) Is the only way to give the system more free memory, to decrease Oracle SGA-Size?

Thanks for all your investigation

Best Regards
Daniel
11 REPLIES 11
Joseph Loo
Honored Contributor

Re: Some Questions about Memory Usage

hi,

A) 2GB of physical memory is pretty low to run Oracle 9i though Oracle has claim that is no problem. The OS take up more than 1GB already which left you about less than 1GB, not to mention when there are some other jobs running which will take up even more memory. Trust me I struggle with keeping up one instance on 2GB memory and literally performance outage happens.

B) try ipcs -mbop where SEGSZ will tell you how much memory is allocated for each active shared memory segments.

C) try this:
# UNIX95= ps -e -o "user,vsz,pid,ppid,args" | sort -rnk2
where vsz column gives you the memory usage in pages.

D) yes, that is one way, but another way is either increase kernel parameter, dbc_max_pct to 10 (percent), use swap or buy some memory.

regards.
what you do not see does not mean you should not believe
Stefan Farrelly
Honored Contributor

Re: Some Questions about Memory Usage

A. shmmax is the maximum value - not what is actually allocated or in use.
B. The sum from ipcs -ma is the actual used (by oracle SGA and other root daemons using shared memory).
C. top is a rough indicator of which processes are using what RAM. To get a more accurate reading use glance/gpm. Or you can use;
UNIX95= ps -eo 'vsz pid args' |sort -nr
The vsz (virtual size) is in Kbytes
D. Yes, the only way to free memory is either decrease oracle SGA size, or get some users off the system, or reduce kernel parameter dbc_mac_pct (down to say 5-10[%]) to free up kernel cache size which may also be quite large.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Stefan Farrelly
Honored Contributor

Re: Some Questions about Memory Usage

oops, that kernel param should be; dbc_max_pct
Im from Palmerston North, New Zealand, but somehow ended up in London...
Daniel Schneider_3
Frequent Advisor

Re: Some Questions about Memory Usage

Thank you very much for your replies.

Do you agree, with the following formula?:

Physical Mem from dmesg + used swap from swapinfo -t = sum of vsz from (UNIX95= ps -eo 'vsz pid args')

If so, there is a gap between like the following values show:

Sum of vsz:__ 2160856 Kb
Mem in dmesg: 2097152 Kb
Diff:__________ 63704 Kb

Used Swap:____ 104380 Kb

Any Ideas about the missung ~40Mb?

Best Regards
Daniel
Joseph Loo
Honored Contributor

Re: Some Questions about Memory Usage

sum of vsz where vsz do not necessary equal to 4kb as it is around that figure. give and take, that may be where the missing 40MB lies.

the formula you have given though looks interesting enough.
what you do not see does not mean you should not believe
Fabio Ettore
Honored Contributor

Re: Some Questions about Memory Usage

Hi Daniel,

check this recent thread with interesting explainations on swapping (and of course about memory management):

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=581312

Hope there are answers for your questions and more.

Best regards,
Ettore
WISH? IMPROVEMENT!
Geoff Wild
Honored Contributor

Re: Some Questions about Memory Usage

Take a look at dbc_max_pct - default is 50 - 50% of memory....you really only need about 325 to 500 MB....set yours to 16....

kmtune -q dbc_max_pct

Attached is a script called processmem - use like this:

# processmem oracle


Memory claimed by oracle: 18701536 Kbytes.


Rgds...Geoff



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Hein van den Heuvel
Honored Contributor

Re: Some Questions about Memory Usage


I see a BAAN process as top user.
I assume you are working with Baan support, or at least the Baan documentation to work within their best-practive recommendations right?

It is running baan appplication code, or just DB client/slave code?
The Baan app is notorious for requiring a DB session per end user. So you end up with lots of Oracle slaves. Those slaves share lots of memory, but all have their own stuff to (mallocs, stack...). How many end users are you configuring for? (and what kind of users?) Is that a significant change from the inputs used to initially configure the box?

My GUESS is that is that you should not expect to use more than 1/2 of your machine for SGA. (For an SAP DB back-end you might configure over 3/4! as it uses fewer processes to do the work).

Is this machine 99% DB server for a baan application? If so, I would much more aggresively tune down the any system memory set aside for 'typical usage'. Specifically a dbc_max_pct of less than 5% may be more reasonable for you.

Joseph wrote:
"The OS take up more than 1GB "
where do you see that? that would not be acceptable and woudl need to be addressed.

Still, 2GB is not much these days. If you have a chance to increase physical memory you should probably push that as this is by far the easiest method to allow for a larger sga!

Good luck,
Hein.
Daniel Schneider_3
Frequent Advisor

Re: Some Questions about Memory Usage

Thank you very much, for your replies.
Yes, Hein, you are right, it's a Baan System. It is for about 20 users and contains the application and the database. I think its not so very less memory. It may be possible, to make the parameters so perfect, that all runs well. The Machine is running max 150 Mb in swap, so this is the value, I have to redistribute.
Do you agree with me?
My next try is, to decrease the value of dbc_max_pct from 20 to 17, and the Oracle target_aggregate_pga from 150 to 100, because the database hasn't used more than 65Mb since startup last week, and the expectance of oracle is about 98% cache hit ratio for that value.

Best Regards
Daniel
Hein van den Heuvel
Honored Contributor

Re: Some Questions about Memory Usage


Thanks for the feedback. I think you are on the right track. Just 20 users should not cause too much memry pressure and indeed one woudl expect to go a long way with the memory you have available. Even at say 20mb/user that is still manageable. I was expecting (without any particular reason/indication) to see 100+ users which would eat up the memory in a hurry.

I would suggest NOT to focus on cache hit percent. Focus more on the remaining IOs. It that load sustainable with a reasonable response time. To exagerate... it your application cause 1M buffer get / sec in Oracle, then even with need 99.9% hit rate you will still need a serious IO subsystem to support the remaining 1000 IO/sec.
If your system does just 1000 buffergets/sec then even at 95% hit rate the remaining 50 IO/sec can readily be delivered by 2 or 3 modest disks.

fwiw,
Hein.
Tom Dineen_2
Advisor

Re: Some Questions about Memory Usage



I always use: ps -el

using: ps -el provides the Actual Memory size being used [Resident Size] at the moment (RSS value similar from the GLANCE command RSS/VSS.)

The [Virtual Size] from "Ps -o .. vsz", compares to the VSS usign glance.

can someone comment on looking at

ps -el

compared with:

UNIX95= ps -eo 'vsz pid args' |sort -nr

can one get the "RSS" from the old ps output?