SlideShare a Scribd company logo
1 of 28
All Oracle DBAs have to know about
            Unix Memory Monitoring
                                              2006-11-14

                        Copyright © 2005 TietoEnator Corporation
Example 1




            Copyright © 2004 TietoEnator Corporation
Example 2




            Copyright © 2004 TietoEnator Corporation
Example 3




            Copyright © 2004 TietoEnator Corporation
Main questions …
 Do I have a memory shortage ?
 How many memory is utilized currently ?

 Why answers are not obvious?




                         Doesn't focus on particular Unix platform
                      Gives general idea of memory management

                                          Copyright © 2004 TietoEnator Corporation
Content
 Concepts of Unix memory management
   – Single process virtual address space & main components
   – Unix swap subsystem
   – Unix system memory components
   – Why it is difficult to say how many memory is utilized

 Possible answers
   – Do I have a memory shortage ?
   – How many memory is utilized currently ?

 Oracle & Memory utilization




                                                Copyright © 2004 TietoEnator Corporation
Single process virtual address space
“Dream world”
       00000000                          0x00000000
     TEXT (CODE)
      - 175MB -                          - 175MB -
       0AEA8000                          0x0AEA8000
   TEXT Variable part
       0AEA8000                          0x0AEA8000
      HEAP (PGA)
      - 849 MB-                          - 849 MB-
       40000000                          0x40000000
  Dynamically loaded
      40000000                           0x40000000
   Libraries (CODE)
     - 256 MB -                          - 256 MB -
   DLL Variable part
      50000000                           0x50000000
    Shared Memory
  BFFE3000(1,75GB)                0xBFFE3000(1,75GB)

     Stack area +
   FFFFFFFF (1GB)                     0xFFFFFFFF (1GB)


                        DEMO
                               pmap


                                            Copyright © 2004 TietoEnator Corporation
Single process virtual memory
 “Dream world”
 Components order and size of memory regions are dependent on used
  platform and Oracle version
 Main components
    – Text (constant/variable parts)
          oracle – executable in case of client process
    – Heap
          PGA – Program Global Area
             – Sort/Hash area
             – Program variables
    – Libraries (constant/variable parts)
          OS/Oracle libraries
          Example: JVM libraries in case of java call within DB
    – Shared Memory
          SGA (shared pool, buffers cache, etc)
   – Stack area
 Each area have strict boundaries for current installation/configuration




                                                               Copyright © 2004 TietoEnator Corporation
Single process virtual memory translation
“Dream world”                                        “Real World”
                                      RAM on DB Server
                                      Random Access Memory
       00000000
     TEXT (CODE)
      - 175MB -
       0AEA8000
   TEXT Variable part
       0AEA8000
      HEAP (PGA)
      - 849 MB-
       40000000            VM
   Dynamically loaded   Translation
       40000000
    Libraries (CODE)
      - 256 MB -
    DLL Variable part
       50000000
    Shared Memory
  BFFE3000(1,75GB)

     Stack area +
   FFFFFFFF (1GB)


                                      SWAP Space on disk                                FS


                                             Copyright © 2004 TietoEnator Corporation
Single process virtual memory translation
 Single process see continues memory space

 OS translate process space to physical locations

 Some parts of virtual process space are shared across all
  running processes
    – OS/Oracle code
    – SGA

 Some memory areas are private for each process


                                           Copyright © 2004 TietoEnator Corporation
Single process virtual address space
          One copy per process (W)   One copy per server (R/O)
    TEXT (CODE)

  TEXT Variable part

     HEAP (PGA)

  Dynamically loaded
   Libraries (CODE)                  One copy per Instance (W)
   DLL Variable part
   Shared Memory

      Stack area




                                           Copyright © 2004 TietoEnator Corporation
Main memory consumption areas
       Process Private Area (W)   Static Code (R/O)
       PGA                        Oracle executables

       Runtime size is variable   Runtime size is constant




                                  Shared Memory (W)
                                  Oracle SGA

                                  Runtime size is constant




                                         Copyright © 2004 TietoEnator Corporation
RAM utilization and swap subsystem
                                                 “Real World”
RAM (size is limited)
  Process Private Area (W)                                            Static Code (R/O)
  PGA                                                                 Oracle executables
                                       ……..
  Runtime size is variable                                            Constant Size


   Shared Memory (W)
   Oracle SGA
   Runtime size is constant



                              Swap Process    Swap out
       Swap in

Disk


                              SWAP Space                                             FS



                                                   Copyright © 2004 TietoEnator Corporation
Swap subsystem
 Allow processes to utilize more memory then available in the system
 Swap process swap out inactive parts of the memory

 On some platforms OS reserve swap space at the time RAM area is
  allocated
    – This is why Oracle recommends to create 2 times swap space
       then RAM installed on the server
    – Because of that used Swap space can’t be used as general
       indicator of memory shortage

 Intensive swap out-s is good indicator of memory shortage




                                                  Copyright © 2004 TietoEnator Corporation
RAM utilization and swap subsystem
                                                 “Real World”
RAM (size is limited)
  Process Private Area (W)                                            Static Code (R/O)
  PGA                                                                 Oracle executables
                                       ……..
  Runtime size is variable                                            Constant Size


   Shared Memory (W)
   Oracle SGA
   Runtime size is constant



                              Swap Process    Swap out
       Swap in

Disk


                              SWAP Space                                             FS



                                                   Copyright © 2004 TietoEnator Corporation
Resident size of the process (RSS)
                   00000000
                 TEXT (CODE)
                  - 175MB -
                   0AEA8000                          SWAP
               TEXT Variable part
                   0AEA8000                                 or
                  HEAP (PGA)
                  - 849 MB-
                   40000000                              DISK
   RAM
              Dynamically loaded
                  40000000
               Libraries (CODE)
                 - 256 MB -                                  or
               DLL Variable part
                  50000000
                                           NOT
                Shared Memory
              BFFE3000(1,75GB)        ALLOCATED
                  Stack area
               FFFFFFFF (1GB)




                                    Copyright © 2004 TietoEnator Corporation
Resident size of the process (RSS)




                             Copyright © 2004 TietoEnator Corporation
Resident size of the process (RSS)
            RSS Part
                   00000000
                 TEXT (CODE)
                  - 175MB -
                   0AEA8000
               TEXT Variable part
                   0AEA8000
                  HEAP (PGA)
                  - 849 MB-
                   40000000
               Dynamically loaded
                   40000000
                Libraries (CODE)
                  - 256 MB -
                DLL Variable part
                   50000000
                 Shared Memory
               BFFE3000(1,75GB)

                   Stack area
                FFFFFFFF (1GB)

                               VSIZE Part



                                        Copyright © 2004 TietoEnator Corporation
How many memory utilized? [OS view]
 OS Tools reflect different information on different platforms

 In general ps, top and other utilities
    – doesn’t reflect Size of Process Private area correctly
    – Include shared parts of the process

 We can’t get figure how many memory utilized by adding
  all RSS or VSIZE values

 pmap like utility can be used (on single process basis)



                                             Copyright © 2004 TietoEnator Corporation
Unix system memory components
Server dedicated to run Oracle Instance



RAM
            Process Private Area (W)   Static
            PGA                        Code
                         ……..          (R/O)
  Kernel    Runtime size is variable
                                       Oracle
    &                                  exe         File System
 System     Shared Memory (W)          Constant       Buffers
Processes   Oracle SGA                 Size
            Runtime size is constant




                                                  Copyright © 2004 TietoEnator Corporation
How many memory is free? [OS View]
 Can we rely on free memory figure from top and others tools?

 The file system cache uses all available free memory to buffer files
  on the file system

 On most systems, the amount of free memory is almost zero

 file system cache used memory freed first of all if there are memory
  shortage

 Free memory figure doesn’t represent available memory in the system




                                                    Copyright © 2004 TietoEnator Corporation
Do I have a memory shortage ?
 Free memory indicator
   – Because of file system cache almost useless
   – If free memory is close to 0 don’t worry

 Swapping activities
   – One of the best OS level indicators
   – Swap out (so), Page out (po), Scan-rate (sr)




                                           Copyright © 2004 TietoEnator Corporation
How many memory is utilized currently ?
 Constant memory areas
   – Kernel & OS Processes
   – Static Code (executables & libraries)
   – Shared Memory (SGA)
 Variable memory areas
   – File System Buffers (freed on demand)
   – Process Private Area (PGA)
RAM
            Process Private Area (W)   Static
            PGA                        Code
                         ……..          (R/O)
  Kernel    Runtime size is variable
                                       Oracle
    &                                  exe         File System
 System     Shared Memory (W)          Constant       Buffers
Processes   Oracle SGA                 Size
            Runtime size is constant


                                                  Copyright © 2004 TietoEnator Corporation
How to see used PGA size?
 Easily can be retrieved from database




 Tuned using DB parameters
   – pga_aggregate_target
   – sort_area_size/hash_area_size
   – SGA




                                          Copyright © 2004 TietoEnator Corporation
Oracle & Memory utilization
 In general Oracle doesn't return used memory back to OS
 Shared server configuration
    – UGA located in       shared pool    PGA is NOT !
    – Single call runtime variables located in PGA
 Background processes
    – Job processes
    – Parallel processes
 SGA_MAX_SIZE
    – Oracle Reserves memory straight after instance startup
 Oracle on 32bit platform
    – Can’t address more then 4GB memory
    – By default 1.7GB big SGA allowed, increase up to 2.7 GB (Note:200266.1)
    – Very Large Memory (VLM) up to 64GB (Note:260152.1)
 Heapdump could be used to troubleshoot memory related problems
    – oradebug dump heapdump 5 (Note:174555.1)




                                                            Copyright © 2004 TietoEnator Corporation
Conclusion
 Do I have a memory shortage ?
   – Free memory is not a good metric
   – Swap size not always good to consider
   – Swap outs is one reliable indicator

 How many memory is utilized currently ?
   – Difficult to see from Unix side
   – Variable part could be retrieved from Oracle
   – There some problems to consider


                                   Copyright © 2004 TietoEnator Corporation
Thank you for your attention …
Q&A




                                 Copyright © 2004 TietoEnator Corporation
Tools to calculate memory usage [OS View]
 ipcs : Shared memory information
   ipcs -m
 pmap : Memory map for a particular process
   pmap <pid> [cat /proc/<pid>/maps]
 ps : Memory information for list of the processes
   ps -u oraenv01 -o pid,vsize,rss,cmdtop
 top : General memory utilization information
   top [cat /proc/meminfo]
 vmstat, sar : Swap activities indicators



                                        Copyright © 2004 TietoEnator Corporation

More Related Content

What's hot

Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Kristofferson A
 
Oda as an enterprise solution at walgreens oow 2012 v7
Oda as an enterprise solution at walgreens oow 2012 v7Oda as an enterprise solution at walgreens oow 2012 v7
Oda as an enterprise solution at walgreens oow 2012 v7
Fuad Arshad
 
How to Modernize Your Database Platform to Realize Consolidation Savings
How to Modernize Your Database Platform to Realize Consolidation SavingsHow to Modernize Your Database Platform to Realize Consolidation Savings
How to Modernize Your Database Platform to Realize Consolidation Savings
Isaac Christoffersen
 
Exadata Patching Demystified
Exadata Patching DemystifiedExadata Patching Demystified
Exadata Patching Demystified
Enkitec
 

What's hot (20)

Oracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesOracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known Features
 
Migrating from Single Instance to RAC Data guard
Migrating from Single Instance to RAC Data guard Migrating from Single Instance to RAC Data guard
Migrating from Single Instance to RAC Data guard
 
Oracle 11g R2 RAC implementation and concept
Oracle 11g R2 RAC implementation and conceptOracle 11g R2 RAC implementation and concept
Oracle 11g R2 RAC implementation and concept
 
What we unlearned_and_learned_by_moving_from_m9000_to_ssc_ukoug2014
What we unlearned_and_learned_by_moving_from_m9000_to_ssc_ukoug2014What we unlearned_and_learned_by_moving_from_m9000_to_ssc_ukoug2014
What we unlearned_and_learned_by_moving_from_m9000_to_ssc_ukoug2014
 
MIgrating from Single Instance to RAC via Dataguard
MIgrating from Single Instance to RAC via DataguardMIgrating from Single Instance to RAC via Dataguard
MIgrating from Single Instance to RAC via Dataguard
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
 
Oracle Exadata X2-8: A Critical Review
Oracle Exadata X2-8: A Critical ReviewOracle Exadata X2-8: A Critical Review
Oracle Exadata X2-8: A Critical Review
 
Sun Oracle Exadata V2 For OLTP And DWH
Sun Oracle Exadata V2 For OLTP And DWHSun Oracle Exadata V2 For OLTP And DWH
Sun Oracle Exadata V2 For OLTP And DWH
 
Oda as an enterprise solution at walgreens oow 2012 v7
Oda as an enterprise solution at walgreens oow 2012 v7Oda as an enterprise solution at walgreens oow 2012 v7
Oda as an enterprise solution at walgreens oow 2012 v7
 
Oracle Database Appliance RAC in a box Some Strings Attached
Oracle Database Appliance RAC in a box Some Strings AttachedOracle Database Appliance RAC in a box Some Strings Attached
Oracle Database Appliance RAC in a box Some Strings Attached
 
How to Modernize Your Database Platform to Realize Consolidation Savings
How to Modernize Your Database Platform to Realize Consolidation SavingsHow to Modernize Your Database Platform to Realize Consolidation Savings
How to Modernize Your Database Platform to Realize Consolidation Savings
 
Oracle Exadata 1Z0-485 Certification
Oracle Exadata 1Z0-485 CertificationOracle Exadata 1Z0-485 Certification
Oracle Exadata 1Z0-485 Certification
 
Understanding Oracle RAC 11g Release 2 Internals
Understanding Oracle RAC 11g Release 2 InternalsUnderstanding Oracle RAC 11g Release 2 Internals
Understanding Oracle RAC 11g Release 2 Internals
 
Oracle Flex ASM - What’s New and Best Practices by Jim Williams
Oracle Flex ASM - What’s New and Best Practices by Jim WilliamsOracle Flex ASM - What’s New and Best Practices by Jim Williams
Oracle Flex ASM - What’s New and Best Practices by Jim Williams
 
Exadata Patching Demystified
Exadata Patching DemystifiedExadata Patching Demystified
Exadata Patching Demystified
 
MySQL Cluster Performance Tuning - 2013 MySQL User Conference
MySQL Cluster Performance Tuning - 2013 MySQL User ConferenceMySQL Cluster Performance Tuning - 2013 MySQL User Conference
MySQL Cluster Performance Tuning - 2013 MySQL User Conference
 
Oracle 11g R2 RAC setup on rhel 5.0
Oracle 11g R2 RAC setup on rhel 5.0Oracle 11g R2 RAC setup on rhel 5.0
Oracle 11g R2 RAC setup on rhel 5.0
 
Customer overview oracle solaris cluster, enterprise edition
Customer overview oracle solaris cluster, enterprise editionCustomer overview oracle solaris cluster, enterprise edition
Customer overview oracle solaris cluster, enterprise edition
 
RMAN best practices for RAC
RMAN best practices for RACRMAN best practices for RAC
RMAN best practices for RAC
 
Exadata
ExadataExadata
Exadata
 

Viewers also liked

Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevBenchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Alex Gorbachev
 
Ebook oracle-thuc-hanh-nguyen-huu-trong
Ebook oracle-thuc-hanh-nguyen-huu-trongEbook oracle-thuc-hanh-nguyen-huu-trong
Ebook oracle-thuc-hanh-nguyen-huu-trong
ngobacuong
 
Nhom 16 big data
Nhom 16 big dataNhom 16 big data
Nhom 16 big data
Duy Phan
 

Viewers also liked (20)

Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevBenchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
 
You most probably dont need an RMAN catalog database
You most probably dont need an RMAN catalog databaseYou most probably dont need an RMAN catalog database
You most probably dont need an RMAN catalog database
 
Presentation disaster recovery for oracle fusion middleware with the zfs st...
Presentation   disaster recovery for oracle fusion middleware with the zfs st...Presentation   disaster recovery for oracle fusion middleware with the zfs st...
Presentation disaster recovery for oracle fusion middleware with the zfs st...
 
Em13c features- HotSos 2016
Em13c features- HotSos 2016Em13c features- HotSos 2016
Em13c features- HotSos 2016
 
Advanced Shell Scripting for Oracle professionals
Advanced Shell Scripting for Oracle professionalsAdvanced Shell Scripting for Oracle professionals
Advanced Shell Scripting for Oracle professionals
 
Em13c New Features- One of Two
Em13c New Features- One of TwoEm13c New Features- One of Two
Em13c New Features- One of Two
 
Upgrading Em13c Collaborate 2016
Upgrading Em13c Collaborate 2016Upgrading Em13c Collaborate 2016
Upgrading Em13c Collaborate 2016
 
Em13c New Features- Two of Two
Em13c New Features- Two of TwoEm13c New Features- Two of Two
Em13c New Features- Two of Two
 
Oracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesOracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New Features
 
Enterprise manager 13c
Enterprise manager 13cEnterprise manager 13c
Enterprise manager 13c
 
Understand
UnderstandUnderstand
Understand
 
Oracle AWR Data mining
Oracle AWR Data miningOracle AWR Data mining
Oracle AWR Data mining
 
10 Problems with your RMAN backup script
10 Problems with your RMAN backup script10 Problems with your RMAN backup script
10 Problems with your RMAN backup script
 
Tối ưu-cau-lệnh-oracle-sql
Tối ưu-cau-lệnh-oracle-sqlTối ưu-cau-lệnh-oracle-sql
Tối ưu-cau-lệnh-oracle-sql
 
Ebook oracle-thuc-hanh-nguyen-huu-trong
Ebook oracle-thuc-hanh-nguyen-huu-trongEbook oracle-thuc-hanh-nguyen-huu-trong
Ebook oracle-thuc-hanh-nguyen-huu-trong
 
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
 
AWR DB performance Data Mining - Collaborate 2015
AWR DB performance Data Mining - Collaborate 2015AWR DB performance Data Mining - Collaborate 2015
AWR DB performance Data Mining - Collaborate 2015
 
Oracle Database In-Memory Meets Oracle RAC
Oracle Database In-Memory Meets Oracle RACOracle Database In-Memory Meets Oracle RAC
Oracle Database In-Memory Meets Oracle RAC
 
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
Oracle RAC 12c (12.1.0.2) Operational Best Practices - A result of true colla...
 
Nhom 16 big data
Nhom 16 big dataNhom 16 big data
Nhom 16 big data
 

Similar to All Oracle DBAs have to know about Unix Memory Monitoring

VDI storage and storage virtualization
VDI storage and storage virtualizationVDI storage and storage virtualization
VDI storage and storage virtualization
Sisimon Soman
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overview
sagaroceanic11
 
Storage virtualization citrix blr wide tech talk
Storage virtualization citrix blr wide tech talkStorage virtualization citrix blr wide tech talk
Storage virtualization citrix blr wide tech talk
Sisimon Soman
 
Sun storage tek 6140 technical presentation
Sun storage tek 6140 technical presentationSun storage tek 6140 technical presentation
Sun storage tek 6140 technical presentation
xKinAnx
 
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Databricks
 
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Databricks
 
SOUG_SDM_OracleDB_V3
SOUG_SDM_OracleDB_V3SOUG_SDM_OracleDB_V3
SOUG_SDM_OracleDB_V3
UniFabric
 

Similar to All Oracle DBAs have to know about Unix Memory Monitoring (20)

Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
 
VDI storage and storage virtualization
VDI storage and storage virtualizationVDI storage and storage virtualization
VDI storage and storage virtualization
 
Why_Oracle_Hardware.ppt
Why_Oracle_Hardware.pptWhy_Oracle_Hardware.ppt
Why_Oracle_Hardware.ppt
 
Orcl siebel-sun-s282213-oow2006
Orcl siebel-sun-s282213-oow2006Orcl siebel-sun-s282213-oow2006
Orcl siebel-sun-s282213-oow2006
 
OMI - The Missing Piece of a Modular, Flexible and Composable Computing World
OMI - The Missing Piece of a Modular, Flexible and Composable Computing WorldOMI - The Missing Piece of a Modular, Flexible and Composable Computing World
OMI - The Missing Piece of a Modular, Flexible and Composable Computing World
 
Collaborate07kmohiuddin
Collaborate07kmohiuddinCollaborate07kmohiuddin
Collaborate07kmohiuddin
 
3PAR and VMWare
3PAR and VMWare3PAR and VMWare
3PAR and VMWare
 
11g R2 Live Part 1
11g R2 Live Part 111g R2 Live Part 1
11g R2 Live Part 1
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overview
 
Storage virtualization citrix blr wide tech talk
Storage virtualization citrix blr wide tech talkStorage virtualization citrix blr wide tech talk
Storage virtualization citrix blr wide tech talk
 
Sun storage tek 6140 technical presentation
Sun storage tek 6140 technical presentationSun storage tek 6140 technical presentation
Sun storage tek 6140 technical presentation
 
Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK
 
Accelerate and Scale Big Data Analytics with Disaggregated Compute and Storage
Accelerate and Scale Big Data Analytics with Disaggregated Compute and StorageAccelerate and Scale Big Data Analytics with Disaggregated Compute and Storage
Accelerate and Scale Big Data Analytics with Disaggregated Compute and Storage
 
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
 
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
Apache Spark on Supercomputers: A Tale of the Storage Hierarchy with Costin I...
 
Engineered Systems: Oracle’s Vision for the Future
Engineered Systems: Oracle’s Vision for the FutureEngineered Systems: Oracle’s Vision for the Future
Engineered Systems: Oracle’s Vision for the Future
 
Session 307 ravi pendekanti engineered systems
Session 307  ravi pendekanti engineered systemsSession 307  ravi pendekanti engineered systems
Session 307 ravi pendekanti engineered systems
 
Storage 101 for VMware admins 2015
Storage 101 for VMware admins 2015Storage 101 for VMware admins 2015
Storage 101 for VMware admins 2015
 
Tendencias Storage
Tendencias StorageTendencias Storage
Tendencias Storage
 
SOUG_SDM_OracleDB_V3
SOUG_SDM_OracleDB_V3SOUG_SDM_OracleDB_V3
SOUG_SDM_OracleDB_V3
 

More from Yury Velikanov

Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Yury Velikanov
 
You most probably dont need rman catalog database white paper
You most probably dont need rman catalog database white paperYou most probably dont need rman catalog database white paper
You most probably dont need rman catalog database white paper
Yury Velikanov
 

More from Yury Velikanov (6)

RAC Attack 12c Installation Instruction
RAC Attack 12c Installation InstructionRAC Attack 12c Installation Instruction
RAC Attack 12c Installation Instruction
 
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
 
Oracle e-Business Suite & RAC 11GR2
Oracle e-Business Suite & RAC 11GR2Oracle e-Business Suite & RAC 11GR2
Oracle e-Business Suite & RAC 11GR2
 
You most probably dont need rman catalog database white paper
You most probably dont need rman catalog database white paperYou most probably dont need rman catalog database white paper
You most probably dont need rman catalog database white paper
 
Yury's CV as of 2013.03.31
Yury's CV as of 2013.03.31Yury's CV as of 2013.03.31
Yury's CV as of 2013.03.31
 
10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

All Oracle DBAs have to know about Unix Memory Monitoring

  • 1. All Oracle DBAs have to know about Unix Memory Monitoring 2006-11-14 Copyright © 2005 TietoEnator Corporation
  • 2. Example 1 Copyright © 2004 TietoEnator Corporation
  • 3. Example 2 Copyright © 2004 TietoEnator Corporation
  • 4. Example 3 Copyright © 2004 TietoEnator Corporation
  • 5. Main questions …  Do I have a memory shortage ?  How many memory is utilized currently ?  Why answers are not obvious? Doesn't focus on particular Unix platform Gives general idea of memory management Copyright © 2004 TietoEnator Corporation
  • 6. Content  Concepts of Unix memory management – Single process virtual address space & main components – Unix swap subsystem – Unix system memory components – Why it is difficult to say how many memory is utilized  Possible answers – Do I have a memory shortage ? – How many memory is utilized currently ?  Oracle & Memory utilization Copyright © 2004 TietoEnator Corporation
  • 7. Single process virtual address space “Dream world” 00000000 0x00000000 TEXT (CODE) - 175MB - - 175MB - 0AEA8000 0x0AEA8000 TEXT Variable part 0AEA8000 0x0AEA8000 HEAP (PGA) - 849 MB- - 849 MB- 40000000 0x40000000 Dynamically loaded 40000000 0x40000000 Libraries (CODE) - 256 MB - - 256 MB - DLL Variable part 50000000 0x50000000 Shared Memory BFFE3000(1,75GB) 0xBFFE3000(1,75GB) Stack area + FFFFFFFF (1GB) 0xFFFFFFFF (1GB) DEMO pmap Copyright © 2004 TietoEnator Corporation
  • 8. Single process virtual memory “Dream world”  Components order and size of memory regions are dependent on used platform and Oracle version  Main components – Text (constant/variable parts)  oracle – executable in case of client process – Heap  PGA – Program Global Area – Sort/Hash area – Program variables – Libraries (constant/variable parts)  OS/Oracle libraries  Example: JVM libraries in case of java call within DB – Shared Memory  SGA (shared pool, buffers cache, etc) – Stack area  Each area have strict boundaries for current installation/configuration Copyright © 2004 TietoEnator Corporation
  • 9. Single process virtual memory translation “Dream world” “Real World” RAM on DB Server Random Access Memory 00000000 TEXT (CODE) - 175MB - 0AEA8000 TEXT Variable part 0AEA8000 HEAP (PGA) - 849 MB- 40000000 VM Dynamically loaded Translation 40000000 Libraries (CODE) - 256 MB - DLL Variable part 50000000 Shared Memory BFFE3000(1,75GB) Stack area + FFFFFFFF (1GB) SWAP Space on disk FS Copyright © 2004 TietoEnator Corporation
  • 10. Single process virtual memory translation  Single process see continues memory space  OS translate process space to physical locations  Some parts of virtual process space are shared across all running processes – OS/Oracle code – SGA  Some memory areas are private for each process Copyright © 2004 TietoEnator Corporation
  • 11. Single process virtual address space One copy per process (W) One copy per server (R/O) TEXT (CODE) TEXT Variable part HEAP (PGA) Dynamically loaded Libraries (CODE) One copy per Instance (W) DLL Variable part Shared Memory Stack area Copyright © 2004 TietoEnator Corporation
  • 12. Main memory consumption areas Process Private Area (W) Static Code (R/O) PGA Oracle executables Runtime size is variable Runtime size is constant Shared Memory (W) Oracle SGA Runtime size is constant Copyright © 2004 TietoEnator Corporation
  • 13. RAM utilization and swap subsystem “Real World” RAM (size is limited) Process Private Area (W) Static Code (R/O) PGA Oracle executables …….. Runtime size is variable Constant Size Shared Memory (W) Oracle SGA Runtime size is constant Swap Process Swap out Swap in Disk SWAP Space FS Copyright © 2004 TietoEnator Corporation
  • 14. Swap subsystem  Allow processes to utilize more memory then available in the system  Swap process swap out inactive parts of the memory  On some platforms OS reserve swap space at the time RAM area is allocated – This is why Oracle recommends to create 2 times swap space then RAM installed on the server – Because of that used Swap space can’t be used as general indicator of memory shortage  Intensive swap out-s is good indicator of memory shortage Copyright © 2004 TietoEnator Corporation
  • 15. RAM utilization and swap subsystem “Real World” RAM (size is limited) Process Private Area (W) Static Code (R/O) PGA Oracle executables …….. Runtime size is variable Constant Size Shared Memory (W) Oracle SGA Runtime size is constant Swap Process Swap out Swap in Disk SWAP Space FS Copyright © 2004 TietoEnator Corporation
  • 16. Resident size of the process (RSS) 00000000 TEXT (CODE) - 175MB - 0AEA8000 SWAP TEXT Variable part 0AEA8000 or HEAP (PGA) - 849 MB- 40000000 DISK RAM Dynamically loaded 40000000 Libraries (CODE) - 256 MB - or DLL Variable part 50000000 NOT Shared Memory BFFE3000(1,75GB) ALLOCATED Stack area FFFFFFFF (1GB) Copyright © 2004 TietoEnator Corporation
  • 17. Resident size of the process (RSS) Copyright © 2004 TietoEnator Corporation
  • 18. Resident size of the process (RSS) RSS Part 00000000 TEXT (CODE) - 175MB - 0AEA8000 TEXT Variable part 0AEA8000 HEAP (PGA) - 849 MB- 40000000 Dynamically loaded 40000000 Libraries (CODE) - 256 MB - DLL Variable part 50000000 Shared Memory BFFE3000(1,75GB) Stack area FFFFFFFF (1GB) VSIZE Part Copyright © 2004 TietoEnator Corporation
  • 19. How many memory utilized? [OS view]  OS Tools reflect different information on different platforms  In general ps, top and other utilities – doesn’t reflect Size of Process Private area correctly – Include shared parts of the process  We can’t get figure how many memory utilized by adding all RSS or VSIZE values  pmap like utility can be used (on single process basis) Copyright © 2004 TietoEnator Corporation
  • 20. Unix system memory components Server dedicated to run Oracle Instance RAM Process Private Area (W) Static PGA Code …….. (R/O) Kernel Runtime size is variable Oracle & exe File System System Shared Memory (W) Constant Buffers Processes Oracle SGA Size Runtime size is constant Copyright © 2004 TietoEnator Corporation
  • 21. How many memory is free? [OS View]  Can we rely on free memory figure from top and others tools?  The file system cache uses all available free memory to buffer files on the file system  On most systems, the amount of free memory is almost zero  file system cache used memory freed first of all if there are memory shortage  Free memory figure doesn’t represent available memory in the system Copyright © 2004 TietoEnator Corporation
  • 22. Do I have a memory shortage ?  Free memory indicator – Because of file system cache almost useless – If free memory is close to 0 don’t worry  Swapping activities – One of the best OS level indicators – Swap out (so), Page out (po), Scan-rate (sr) Copyright © 2004 TietoEnator Corporation
  • 23. How many memory is utilized currently ?  Constant memory areas – Kernel & OS Processes – Static Code (executables & libraries) – Shared Memory (SGA)  Variable memory areas – File System Buffers (freed on demand) – Process Private Area (PGA) RAM Process Private Area (W) Static PGA Code …….. (R/O) Kernel Runtime size is variable Oracle & exe File System System Shared Memory (W) Constant Buffers Processes Oracle SGA Size Runtime size is constant Copyright © 2004 TietoEnator Corporation
  • 24. How to see used PGA size?  Easily can be retrieved from database  Tuned using DB parameters – pga_aggregate_target – sort_area_size/hash_area_size – SGA Copyright © 2004 TietoEnator Corporation
  • 25. Oracle & Memory utilization  In general Oracle doesn't return used memory back to OS  Shared server configuration – UGA located in shared pool PGA is NOT ! – Single call runtime variables located in PGA  Background processes – Job processes – Parallel processes  SGA_MAX_SIZE – Oracle Reserves memory straight after instance startup  Oracle on 32bit platform – Can’t address more then 4GB memory – By default 1.7GB big SGA allowed, increase up to 2.7 GB (Note:200266.1) – Very Large Memory (VLM) up to 64GB (Note:260152.1)  Heapdump could be used to troubleshoot memory related problems – oradebug dump heapdump 5 (Note:174555.1) Copyright © 2004 TietoEnator Corporation
  • 26. Conclusion  Do I have a memory shortage ? – Free memory is not a good metric – Swap size not always good to consider – Swap outs is one reliable indicator  How many memory is utilized currently ? – Difficult to see from Unix side – Variable part could be retrieved from Oracle – There some problems to consider Copyright © 2004 TietoEnator Corporation
  • 27. Thank you for your attention … Q&A Copyright © 2004 TietoEnator Corporation
  • 28. Tools to calculate memory usage [OS View]  ipcs : Shared memory information ipcs -m  pmap : Memory map for a particular process pmap <pid> [cat /proc/<pid>/maps]  ps : Memory information for list of the processes ps -u oraenv01 -o pid,vsize,rss,cmdtop  top : General memory utilization information top [cat /proc/meminfo]  vmstat, sar : Swap activities indicators Copyright © 2004 TietoEnator Corporation

Editor's Notes

  1. From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Seema Singh Sent: Thursday, May 06, 2004 3:46 PM To: oracle-l@xxxxxxxxxxxxx Subject: How much Max oracle memory (SGA)can be allocated on SUN SOLARIS if RAM =1.5gb Hi How much maximum SGA we can allocate if MEMORY on SUN Solaris is 1.5gb? When sga alloacted to 220mb, top command show 46mb free.when I bumped sga to 225mb it&apos;s still showing 46m is free. thx-seema ANSWER: Seema It is quite normal to have free memory to hover around this low. Read on if you are interested in knowing why. From Solaris 2.6 onwards Virtual Memory Manager will use as much as memory available, to benefit file system random IO. If you have heavy random file system activity then the memory can be filled with these file pages. This might not be well suited for database environments. Paging kicks-in when free memory falls below lotfree kernel parameter. Swapping and paging, can page out the process exec pages, heap and stack, even though the physical memory is filled with file pages (Whether SGA can be swapped/paged depends upon ISM-Intimate Shared Memory use, as the shared memory segments are locked if ISM is used ). This can create application performance issues, including database performance issues. Both background and server processes are susceptible to be paged out, if there is massive random IO. Solaris 2.6+ introduced priority_paging to alleviate this. If priority paging is enabled, then the paging daemon pages the file pages when the free memory falls below a new parameter cachefree which is higher than lotfree. This paging will differentiate between file pages and anonymous pages and so the file pages will be paged out before process&apos; pages are considered. Solaris 2.8 introduces cyclical page cache, where the file and anonymous pages are handled differently. So, this issues should not exists in 2.8. Point is, as long as you have priority_paging enabled in 2.6, (In 2.7 it is enabled by default) you don&apos;t need to be concerned. I would be concerned only if there is paging/swapping for anonymous pages. Memstat can tell you what is being paged/swapped, if you are in 2.8. I am not suggesting you to increase the SGA, by any means. That shoud be decided by database/app behavior, not just by this.. HTH Thanks Riyaj &quot;Re-yas&quot; Shamsudeen Certified Oracle DBA