Re: Memory used by a single oracle server process in Solaris

From: Sreejith S Nair <Sreejith.Sreekantan_at_ibsplc.com>
Date: Tue, 23 Aug 2011 19:00:51 +0530
Message-ID: <OF54D391F7.BD653503-ON652578F5.0042BD4A-652578F5.004A3C60_at_ibsplc.com>



Hi Jonathan,

Thanks for your time.

This is what I got from MOS doc - UNIX: Determining the Size of an Oracle Process [ID 174555.1] which I have followed in analyzing this.

A process in memory is composed of several parts:

                 shared memory    (the SGA)
                 shared libraries (both public, and private)
                 private data     (referred to as DATA, or heap)
                 the executable   (referred to as TEXT)
The SGA and TEXT regions are shared by all Oracle processes. These are mapped only once into memory, and not once per process. As such, these are not part of the incremental cost of spawning a new Oracle process.

commands such as 'ps' and 'top' include TEXT sizes when measuring private data. Further, the SGA size can also be included, giving a wildly inaccurate figure for the private data of a server process. Some operating systems provide better tools for measuring process sizes. For example, Solaris has /usr/proc/bin/pmap

This is what I get from pmap

ibsjpsrv3 oracle [TWPRD]:pmap -x 27430 | grep heap 000000000E8DD000 1720 1676 1676 - rw--- [ heap ] ------------->Private DATA
ibsjpsrv3 oracle [TWPRD]:
ibsjpsrv3 oracle [TWPRD]:pmap -x 27430 | grep oracle 27430: oracleTWPRD (LOCAL=NO)
0000000000400000 232736 83612 - - r-x-- oracle ---------->TEXT
000000000E757000 1424 880 236 - rw--- oracle---------->TEXT
000000000E8BB000 136 44 44 - rw--- oracle---------->TEXT
ibsjpsrv3 oracle [TWPRD]:pmap -x 27430 | grep shmid 0000000060000000 5244928 4710400 - - rwxs- [ dism shmid=0x14 ] --------------> SGA

I am just wondering where exactly the PGA size, I got , is accommodated in OS commands ( both pmap and ps )

PGA Size = 76 MB from SQL Command
PS Command RSS = 4730 MB
PMAP Command SGA = 4710 MB

PS Command RSS - PMAP Command SGA = 20 MB.

Where exactly does PGA ( 75 MB ) for this session goes to ?

SQL> select PGA_USED_MEM/1024/1024 used_mb,PGA_ALLOC_MEM/1024/1024 alloc_mb,PGA_FREEABLE_MEM/1024/1024 free_mb,PGA_MAX_MEM/1024/1024 max_mb from v$process where spid=27430;  

   USED_MB ALLOC_MB FREE_MB MAX_MB ---------- ---------- ---------- ---------- 71.9989109 87.611393 12.625 220.923893  

SQL> select CATEGORY,ALLOCATED/1024/1024 allocated_mb,USED/1024/1024 USED_MB,MAX_ALLOCATED/1024/1024 max_mb from v$process_memory where pid=114;  

CATEGORY ALLOCATED_MB USED_MB MAX_MB --------------- ------------ ---------- ----------

SQL               .136795044    .004920959 153.053238
PL/SQL            60.8475571    .006774902 66.7705688
JAVA              4.70097351     4.69393921 6.37259674
Freeable              12.625             0
Other             9.30106735           9.30106735

Here is complete pmap and ps output.

ps -efo pmem,rss,pid,pcpu,args | sort -r | head -20

19.3 4730640 27430  0.0 oracleTBDB (LOCAL=NO)
19.3 4727152  5282  0.0 oracleTBDB (LOCAL=NO)
19.3 4724896  5362  0.0 oracleTBDB (LOCAL=NO)
19.3 4723324 27422  0.0 oracleTBDB (LOCAL=NO)
19.3 4722212  5346  1.0 oracleTBDB (LOCAL=NO)



--
Thanks,
Sreejith



From:   "Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk>
To:     <oracle-l_at_freelists.org>
Date:   08/23/2011 04:25 PM
Subject:        Re: Memory used by a single oracle server process in 
Solaris
Sent by:        oracle-l-bounce_at_freelists.org




Sreejith

Following up on just the OTN thread from now on, but won't pmap also be 
reporting the size of the Oracle executable - which is probably around the 
100MB 
difference you're seeing.

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com


----- Original Message ----- 
From: "Sreejith S Nair" <Sreejith.Sreekantan_at_ibsplc.com>
To: <jonathan_at_jlcomp.demon.co.uk>
Cc: <oracle-l_at_freelists.org>; <oracle-l-bounce_at_freelists.org>
Sent: Tuesday, August 23, 2011 11:19 AM
Subject: Re: Memory used by a single oracle server process in Solaris



> This comes close to what I got from 'session_pga_memory' which is close
> to 71 MB.
>
> Still, I did not get the memory I derived from this calculation .
>
> shared memory= 4710400 ( shmid from pmap )
> RSS = 4901764 from pmap and ps .
>
> So RSS - shared memory = PGA used by this process + (code + data ) ?
>
> If Yes then PGA + (code + data ) = 4901764 - 4710400 = 191364 kb = 186
> MB.
>
> I am getting PGA as 71 MB, so rest ( 186 - 71 ) is the memory for code +
> data ?
>
> I suspect, I might be missing something here ?
>
-- http://www.freelists.org/webpage/oracle-l DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."


-- http://www.freelists.org/webpage/oracle-l
Received on Tue Aug 23 2011 - 08:30:51 CDT

Original text of this message