Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Calculating Physical memory for Oracle Sessions

Re: Calculating Physical memory for Oracle Sessions

From: Tim Gorman <tim_at_evdbt.com>
Date: Thu, 30 Nov 2006 12:31:22 -0700
Message-Id: <20061130192440.M29083@evdbt.com>


Comments inline prefixed by "[Tim]"...

-Tim

Jared Still wrote:
> On 11/30/06, Jesse, Rich <Rich.Jesse_at_qg.com> wrote:
>
> Jared, wouldn't your formula multiply shared memory (e.g. Oracle
> SGA size as reported by "ipcs -ma") by the number of Oracle processes
> (except for procs that don't connect to the instance, like the listener)?
> I think using ps output that way would be like saying that adding 25% of
> "X" and 25% of "Y" must equal 50% of "X+Y".
>
> While I've never taken the time (had the time?) to dealve into it, I
> think that pmap is accurate iff shared memory is accounted for. The trick
> is to determine if any other process is accessing that shared memory.

[Tim] - which the "oramem.sh" script does. It does not aggregate shared memory or "text" -- it finds the max value for those items within the Oracle server processes. The script *does* aggregate "stack" and "data" (i.e. "private" memory) within the processes.

>
>
> Which is another way of saying that pmap is not accurate. ;)

[Tim] - Jared, I have to disagree with you. "Pmap" is apparently accurate for each process. It is just that shared memory numbers (i.e. "shm" and shared "text" images) do not aggregate well when extracted from process-level utilities such as "pmap" and "ps". The numbers have to be treated differently, as "oramem.sh" does...
>
> My knee jerk is that this could be accomplished by making a "master"
> list of shared memory (possibly using pmap outputs) to evaluate against
> whatever subset of processes you would want to see.
>
>
> I do it with ipcs and /proc/*/maps

[Tim] - does your method come up with different figures than "oramem.sh"?

>
> This blog item mentions this problem, but doesn't really offer a
> solution:
>
>

http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html
>
>
> I've probably already read that blog.
>
> Kinda wierd that no one's thought of a solution (even if it's only a
> 99% one) to this, ain't it?

[Tim] - haven't they? :-)

>
>
>
> I have a solution (for linux) that comes fairly close.
>
> It involves a perl script to get a list of process ID's from ps, then
> calculates the memory usage from raw data in /proc/*/maps. There
> is also a small C program to get pagesize.

[Tim] - feel free to rewrite "oramem.sh" into "oramem.pl"... :-)

>
> --
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Nov 30 2006 - 13:31:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US