SlideShare ist ein Scribd-Unternehmen logo
1 von 35
MEMORY MANAGEMENT




      9/3/2012      1
Agenda
 Introduction to Solaris
 History of solaris
 Solaris memory architecture.
 Backing store
 VM system.
 Solaris memory management.
 Swapping
 Demand paging.




                       9/3/2012   2
Introduction to solaris
 Solaris is a Unix operating system originally
  developed by Sun Microsystems.
 Solaris is known for its scalability especially on
  SPARC systems and for originating many
  innovative features such as DTrace, ZFS and Time
  Slider.
 Solaris supports SPARC-based and x-86 based
  workstation and servers from Sun and other
  vendors.
 Solaris has a reputation for being well-suited to
  symmetric multiprocessing, supporting a large
  number of CPUs.
 Programmed in C.
                            9/3/2012                   3
 Its source model is Mixed open source/closed
History of solaris
 In earlier days SunOS is implemented in
  uniprocessor workstation.
 In 1980’s distributed and network-based computing
  became popular, so they went to multiprocessor
  system to speedup.
 In 1987, AT&T bell and Sun joined together for a
  project and developed a new OS by merging the
  existing OS.(SunOS,BSD,SVR3,Xenix).
 That new OS is named as System V Release 4
  (SVR4) and then its name changed as Solaris 2.
 Latest version is Solaris 11.



                        9/3/2012                      4
Solaris Memory Architecture

   Physical memory is divided into fixed-sized pieces
    called pages.
   The size of the page varies from platform to
    platform.
   The common size is 8 Kbytes.
   Each page is associated with a file and offset.
   The file and offset identify the backing store for the
    page.




                            9/3/2012                         5
Backing store
   Backing store is the location to which the physical
    page contents will be migrated when that page is
    need to be taken for another process.

   The pages are migrated to slower medium like disk
    and that is called swap space.

   The location where the pages are migrated is
    called page-out.

   When again that pages are needed by the process,
    the location from which the pages are read back
    again is called page-in.
                           9/3/2012                       6
Virtual memory System
   Virtual memory system is the core for a Solaris
    system.


Why have a Virtual memory System?

 It presents simple memory programming model.
 It allows process to see linear range of bytes,
  regardless of fragmentation of the real memory.
 It gives programming model with a larger size than
  available physical storage.


                            9/3/2012                   7
Jobs of VM System
   The job of VM system is to keep the most
    frequently referenced portions of memory in
    primary storage.

   When RAM shortage comes, VM is required to free
    the RAM by transfering infrequently used memory
    out to the backing store.

   By doing so,the VM system optimizes the
    performance.

   VM system supports multiple users and sharing of
    pages and thus provide protection.
                           9/3/2012                    8
Process Memory Allocation
   A process will have a linear virtual address space.

   The linear Virtual address space of a process is
    divided into segments like

 Executable-text : Executable instructions in
  binary form
 Executable-Data : Initialized variables in the
  executable
 Heap space      : Memory allocated by malloc()
 Process Stack and so on……



                           9/3/2012                       9
Process memory allocation




           9/3/2012         10
Solaris virtual to physical memory
            management




                9/3/2012             11
Virtual memory management unit(MMU)

   Solaris kernel breaks the process into segments
    and segments into pages.

   The hardware MMU maps those pages into
    physical memory by using a platform-specific set of
    translation tables.

   Each entry in the table has the physical address of
    the page of the RAM,so that memory access can
    be converted on-the-fly in hardware.




                           9/3/2012                       12
Shared Mapped File




        9/3/2012     13
Solaris Memory Management
    Two basic types of memory management manage
     the allocation and migration of physical pages of
     memory to and from swap space :



               1.Swapping
               2.Demand paging



   The VM system uses a global paging model that
    implements a single global policy to manage the
    allocation of memory between the processes.
                          9/3/2012                    14
Swapping
   The swapping algorithm uses user process as the
    granularity for managing memory.

   If there is a shortage of memory, then all the pages
    of the least active process will be swapped out to
    the swap device, freeing memory for other
    processes.

   Then the corresponding flag in the process table is
    set to indicate that this process has been swapped
    out.



                           9/3/2012                        15
Memory Scheduler
   The memory scheduler is launched at boot time
    and does nothing.

   If the memory is consistently less, it starts looking
    for processes that it can completely swap out.

   If shortage is minimal, then soft swap takes place.

   Otherwise hard-swap.



                             9/3/2012                       16
Soft Swapping

   If the process have been inactive for atleast
    maxslp(default 20 seconds) seconds, then memory
    sceduler swaps out all the pages for that process.




                           9/3/2012                      17
Hard Swapping
   Hard swapping takes place when all of the
    following are true :

 Atleast two processes are on the run queue,
  waiting for CPU.
 The average free memory over 30 seconds is
  consistently less than minimum.
 Excessive paging (page-out + page-in is high).




                          9/3/2012                 18
Pros and Cons of Swapping
   Pros:
      1.This is the inexpensive way to conserve
    memory.
      2. Easy implementation.

   Cons:
      1. It dramatically affects a process’s
    performance.



    So the swapping is used only as a last resort when
           the system is desperate for memory.
                            9/3/2012                     19
Demand paging
   The Demand paging model uses a page as the
    granularity for memory management.

   Pages of memory are allocated on demand.

   When memory is first referenced, a page fault
    occurs and memory is allocated one page at a
    time.

   The page scanner and the virtual memory page
    fault mechanism are the core of the demand paged
    memory management.
                           9/3/2012                    20
Page Scanner
   The page scanner is a kernel thread, which is
    awakened when the amount of memory on the
    free-page list falls below a system threshhold,
    typically 1/64 th of total physical memory.

   Scanner (pageout_scanner) tracks pages by
    reading the state of the hardware bits in MMU
      – MMU bits maintain state of referenced and
    written
         (dirty).
      – Uses a twohanded clock algorithm to
    determine
         eviction.
                           9/3/2012                   21
Two Handed Clock Algorithm




 Both hands rotate clock-wise.
 The front hand clears the referenced and modified
  bit of each page.
 The trailing back hand then inspects the referenced
  and modified bits some time later.

                         9/3/2012                   22
Scan Rate
 The scan rate changes during the course of the
  page scanners operation
   Scanners scans at slowscan when memory is
  below lotsfree and then increases to fastscan
  when memory has fallen below minfree
  threshold

    Slowscan is set to 100 pages by default.

     Fastscan is set to physicalmemory/2 capped
    at 8192 pages

                        9/3/2012                   23
Page Faults
When do Page Faults occur?
   MMU-generated exceptions (trap) tell the operating
    system when a memory access cannot continue
    without the kernel’s intervention.

 Three major types of memory-related hardware
  exceptions can occur:
 Major page faults
 Minor page faults
 Protection faults




                          9/3/2012                   24
Advantages of Demand
              paging
   Loading pages of memory on demand dramatically
    lowers the memory footprint
     Memory footprint refers to the amount of main memory
      that a program uses or references while running.
   And startup time of the process.




                             9/3/2012                        25
Memory sharing

Multiple users’ processes can share memory

 Multiple processes can sharing program binaries
  and application data.
 The Solaris kernel introduced dynamically linked
  libraries.




                        9/3/2012                     26
Memory protection
 A user’s process must not be able access the
  memory of another process.
 A program fault in one program could cause
  another program (or the entire operating system) to
  fail.
 The protection is implemented by using protection
  modes read, write, execute and boundary
  checking.




                        9/3/2012                    27
Kernel Virtual Memory Layout

 The kernel uses virtual memory and MMU like the
  process.
 The kernel uses top 256 Mbytes or 512 Mbytes in
  common virtual address space.
 Most of the kernel memory are not pageable.
 This characteristics avoids the deadlocks.
 The kernel cannot rely on the global paging.




                        9/3/2012                    28
Kernel Memory Allocation
   Kernel memory is allocated at different levels.

    Page allocator
          It allocates unmapped pages from the free list
    to the kernel address space.
          Solaris uses Resource map allocator to
    allocate the free memory to the kernel.
           Resource map allocator uses first-fit
    algorithm.




                           9/3/2012                    29
Kernel Memory Slab Allocator
   Solaris provides a general-purpose memory
    allocator that provides arbitrarily sized memory
    allocations.

We use the slab allocator for memory requests that
 are:
 Smaller than a page size
 Not an even multiple of a page size
 Frequently going to be allocated and freed, so
 would otherwise fragment the kernel map



                           9/3/2012                    30
Why Slab Allocator?
   The reasons for introducing the slab allocator were
    as follows:

  The SVR4 allocator was slow to satisfy allocation
  requests.
 Significant fragmentation problems arose with use
  of the SVR4 allocator.
 The allocator footprint was large, wasting a lot of
  memory.
 With no clean interfaces for memory allocation,
  code was duplicated in many places.


                           9/3/2012                       31
9/3/2012   32
 The slab allocator uses the term object to describe
  a single memory allocation unit.
 Cache to refer to a pool of like objects.
 Slab to refer to a group of objects that reside within
  the cache.
 Slab allocator solves many of the fragmentation
  issues by grouping different sized memory objects.
 Many cache will be activate at once in the solaris
  kernel.



                          9/3/2012                     33
References
Book:
     SOLARIS Internals,Core Kernel
    Architecture,Sun Microsystems.
Website:
   www.sun.com




                         9/3/2012     34
THANK YOU….



     9/3/2012   35

Weitere ähnliche Inhalte

Was ist angesagt?

Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsDrishti Bhalla
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Linux process management
Linux process managementLinux process management
Linux process managementRaghu nath
 
Operating system structures
Operating system structuresOperating system structures
Operating system structuresMohd Arif
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumptionhaish
 
Protection and Security in Operating Systems
Protection and Security in Operating SystemsProtection and Security in Operating Systems
Protection and Security in Operating Systemsvampugani
 
Operating Systems: Virtual Memory
Operating Systems: Virtual MemoryOperating Systems: Virtual Memory
Operating Systems: Virtual MemoryDamian T. Gordon
 
Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer Oshin Kandpal
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
First fit , Best fit, Worst fit
First fit , Best fit, Worst fitFirst fit , Best fit, Worst fit
First fit , Best fit, Worst fitShahzeb Amjad
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor ManagementDamian T. Gordon
 

Was ist angesagt? (20)

VIRTUAL MEMORY
VIRTUAL MEMORYVIRTUAL MEMORY
VIRTUAL MEMORY
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
Memory management
Memory managementMemory management
Memory management
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Linux memory
Linux memoryLinux memory
Linux memory
 
Raid and its levels
Raid and its levelsRaid and its levels
Raid and its levels
 
Operating system structures
Operating system structuresOperating system structures
Operating system structures
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumption
 
Protection and Security in Operating Systems
Protection and Security in Operating SystemsProtection and Security in Operating Systems
Protection and Security in Operating Systems
 
Operating Systems: Virtual Memory
Operating Systems: Virtual MemoryOperating Systems: Virtual Memory
Operating Systems: Virtual Memory
 
Operating System
Operating SystemOperating System
Operating System
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer Presentation on Virtual Memory concepts in computer
Presentation on Virtual Memory concepts in computer
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
File Management
File ManagementFile Management
File Management
 
First fit , Best fit, Worst fit
First fit , Best fit, Worst fitFirst fit , Best fit, Worst fit
First fit , Best fit, Worst fit
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
Windows kernel
Windows kernelWindows kernel
Windows kernel
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor Management
 

Andere mochten auch

Unix memory management
Unix memory managementUnix memory management
Unix memory managementTech_MX
 
Solaris Operating System
Solaris Operating SystemSolaris Operating System
Solaris Operating SystemJoshua Guillano
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in LinuxRaghu Udiyar
 
Solaris 9 Installation Guide
Solaris 9 Installation GuideSolaris 9 Installation Guide
Solaris 9 Installation Guideequalnull
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File ManagementDamian T. Gordon
 
Solaris, OpenSolaris y Virtualización
Solaris, OpenSolaris y VirtualizaciónSolaris, OpenSolaris y Virtualización
Solaris, OpenSolaris y Virtualizaciónjuandanielp
 
Solaris Operating System - Oracle
 Solaris Operating System - Oracle Solaris Operating System - Oracle
Solaris Operating System - OracleMalan Amarasinghe
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory ManagementAkmal Cikmat
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
SOLAR PROJECT MANAGEMENT
SOLAR PROJECT MANAGEMENTSOLAR PROJECT MANAGEMENT
SOLAR PROJECT MANAGEMENTAmrit pal singh
 
Solar management unit with data logger
Solar management unit with data loggerSolar management unit with data logger
Solar management unit with data loggerAmit Kumar Sharma
 
Open Solaris 2008.05
Open Solaris 2008.05Open Solaris 2008.05
Open Solaris 2008.05Angad Singh
 
Ecmascript 6 (ES6) جافا سكربت (6)
Ecmascript 6 (ES6) جافا سكربت (6)Ecmascript 6 (ES6) جافا سكربت (6)
Ecmascript 6 (ES6) جافا سكربت (6)anees abu-hmaid
 
Advantages and disadvantages solaris
Advantages and disadvantages solarisAdvantages and disadvantages solaris
Advantages and disadvantages solarisNur Shukri
 
memory management of windows vs linux
memory management of windows vs linuxmemory management of windows vs linux
memory management of windows vs linuxSumit Khanka
 

Andere mochten auch (20)

Unix memory management
Unix memory managementUnix memory management
Unix memory management
 
Solaris Operating System
Solaris Operating SystemSolaris Operating System
Solaris Operating System
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in Linux
 
Solaris 9 Installation Guide
Solaris 9 Installation GuideSolaris 9 Installation Guide
Solaris 9 Installation Guide
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File Management
 
Solaris, OpenSolaris y Virtualización
Solaris, OpenSolaris y VirtualizaciónSolaris, OpenSolaris y Virtualización
Solaris, OpenSolaris y Virtualización
 
Solaris Operating System - Oracle
 Solaris Operating System - Oracle Solaris Operating System - Oracle
Solaris Operating System - Oracle
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
SOLAR PROJECT MANAGEMENT
SOLAR PROJECT MANAGEMENTSOLAR PROJECT MANAGEMENT
SOLAR PROJECT MANAGEMENT
 
Solar management unit with data logger
Solar management unit with data loggerSolar management unit with data logger
Solar management unit with data logger
 
Open Solaris 2008.05
Open Solaris 2008.05Open Solaris 2008.05
Open Solaris 2008.05
 
Ecmascript 6 (ES6) جافا سكربت (6)
Ecmascript 6 (ES6) جافا سكربت (6)Ecmascript 6 (ES6) جافا سكربت (6)
Ecmascript 6 (ES6) جافا سكربت (6)
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
 
Advantages and disadvantages solaris
Advantages and disadvantages solarisAdvantages and disadvantages solaris
Advantages and disadvantages solaris
 
memory management of windows vs linux
memory management of windows vs linuxmemory management of windows vs linux
memory management of windows vs linux
 

Ähnlich wie Os solaris memory management

Power Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptPower Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptRahulRaj395610
 
Windows memory management
Windows memory managementWindows memory management
Windows memory managementTech_MX
 
I/O System and Case Study
I/O System and Case StudyI/O System and Case Study
I/O System and Case StudyGRamya Bharathi
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case studyLavanya G
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryAshik Iqbal
 
Chapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptChapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptMonirJihad1
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case studymalarselvi mms
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Abhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptxAbhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptxwemoji5816
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.pptPratikBose10
 

Ähnlich wie Os solaris memory management (20)

ppt
pptppt
ppt
 
virtual memory - Computer operating system
virtual memory - Computer operating systemvirtual memory - Computer operating system
virtual memory - Computer operating system
 
Power Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.pptPower Point Presentation on Virtual Memory.ppt
Power Point Presentation on Virtual Memory.ppt
 
Windows memory management
Windows memory managementWindows memory management
Windows memory management
 
I/O System and Case Study
I/O System and Case StudyI/O System and Case Study
I/O System and Case Study
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case study
 
Nachos 2
Nachos 2Nachos 2
Nachos 2
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache Memory
 
Chapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptChapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.ppt
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case study
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Paging-R.D.Sivakumar
Paging-R.D.SivakumarPaging-R.D.Sivakumar
Paging-R.D.Sivakumar
 
Paging-R.D.Sivakumar
Paging-R.D.SivakumarPaging-R.D.Sivakumar
Paging-R.D.Sivakumar
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
Abhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptxAbhaycavirtual memory and the pagehit.pptx
Abhaycavirtual memory and the pagehit.pptx
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
VirutualMemory.docx
VirutualMemory.docxVirutualMemory.docx
VirutualMemory.docx
 
Os
OsOs
Os
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 

Mehr von Tech_MX

Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Stack data structure
Stack data structureStack data structure
Stack data structureTech_MX
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2Tech_MX
 
Set data structure
Set data structure Set data structure
Set data structure Tech_MX
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Tech_MX
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pcTech_MX
 
More on Lex
More on LexMore on Lex
More on LexTech_MX
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbmsTech_MX
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 

Mehr von Tech_MX (20)

Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Uid
UidUid
Uid
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
String & its application
String & its applicationString & its application
String & its application
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Stack data structure
Stack data structureStack data structure
Stack data structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Spss
SpssSpss
Spss
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Set data structure
Set data structure Set data structure
Set data structure
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Parsing
ParsingParsing
Parsing
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pc
 
More on Lex
More on LexMore on Lex
More on Lex
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbms
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 

Kürzlich hochgeladen

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
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 challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 DiscoveryTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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 FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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 educationjfdjdjcjdnsjd
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
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 FMESafe Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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.pdfsudhanshuwaghmare1
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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 2024Victor Rentea
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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 WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 

Os solaris memory management

  • 1. MEMORY MANAGEMENT 9/3/2012 1
  • 2. Agenda  Introduction to Solaris  History of solaris  Solaris memory architecture.  Backing store  VM system.  Solaris memory management.  Swapping  Demand paging. 9/3/2012 2
  • 3. Introduction to solaris  Solaris is a Unix operating system originally developed by Sun Microsystems.  Solaris is known for its scalability especially on SPARC systems and for originating many innovative features such as DTrace, ZFS and Time Slider.  Solaris supports SPARC-based and x-86 based workstation and servers from Sun and other vendors.  Solaris has a reputation for being well-suited to symmetric multiprocessing, supporting a large number of CPUs.  Programmed in C. 9/3/2012 3  Its source model is Mixed open source/closed
  • 4. History of solaris  In earlier days SunOS is implemented in uniprocessor workstation.  In 1980’s distributed and network-based computing became popular, so they went to multiprocessor system to speedup.  In 1987, AT&T bell and Sun joined together for a project and developed a new OS by merging the existing OS.(SunOS,BSD,SVR3,Xenix).  That new OS is named as System V Release 4 (SVR4) and then its name changed as Solaris 2.  Latest version is Solaris 11. 9/3/2012 4
  • 5. Solaris Memory Architecture  Physical memory is divided into fixed-sized pieces called pages.  The size of the page varies from platform to platform.  The common size is 8 Kbytes.  Each page is associated with a file and offset.  The file and offset identify the backing store for the page. 9/3/2012 5
  • 6. Backing store  Backing store is the location to which the physical page contents will be migrated when that page is need to be taken for another process.  The pages are migrated to slower medium like disk and that is called swap space.  The location where the pages are migrated is called page-out.  When again that pages are needed by the process, the location from which the pages are read back again is called page-in. 9/3/2012 6
  • 7. Virtual memory System  Virtual memory system is the core for a Solaris system. Why have a Virtual memory System?  It presents simple memory programming model.  It allows process to see linear range of bytes, regardless of fragmentation of the real memory.  It gives programming model with a larger size than available physical storage. 9/3/2012 7
  • 8. Jobs of VM System  The job of VM system is to keep the most frequently referenced portions of memory in primary storage.  When RAM shortage comes, VM is required to free the RAM by transfering infrequently used memory out to the backing store.  By doing so,the VM system optimizes the performance.  VM system supports multiple users and sharing of pages and thus provide protection. 9/3/2012 8
  • 9. Process Memory Allocation  A process will have a linear virtual address space.  The linear Virtual address space of a process is divided into segments like  Executable-text : Executable instructions in binary form  Executable-Data : Initialized variables in the executable  Heap space : Memory allocated by malloc()  Process Stack and so on…… 9/3/2012 9
  • 11. Solaris virtual to physical memory management 9/3/2012 11
  • 12. Virtual memory management unit(MMU)  Solaris kernel breaks the process into segments and segments into pages.  The hardware MMU maps those pages into physical memory by using a platform-specific set of translation tables.  Each entry in the table has the physical address of the page of the RAM,so that memory access can be converted on-the-fly in hardware. 9/3/2012 12
  • 13. Shared Mapped File 9/3/2012 13
  • 14. Solaris Memory Management  Two basic types of memory management manage the allocation and migration of physical pages of memory to and from swap space : 1.Swapping 2.Demand paging  The VM system uses a global paging model that implements a single global policy to manage the allocation of memory between the processes. 9/3/2012 14
  • 15. Swapping  The swapping algorithm uses user process as the granularity for managing memory.  If there is a shortage of memory, then all the pages of the least active process will be swapped out to the swap device, freeing memory for other processes.  Then the corresponding flag in the process table is set to indicate that this process has been swapped out. 9/3/2012 15
  • 16. Memory Scheduler  The memory scheduler is launched at boot time and does nothing.  If the memory is consistently less, it starts looking for processes that it can completely swap out.  If shortage is minimal, then soft swap takes place.  Otherwise hard-swap. 9/3/2012 16
  • 17. Soft Swapping  If the process have been inactive for atleast maxslp(default 20 seconds) seconds, then memory sceduler swaps out all the pages for that process. 9/3/2012 17
  • 18. Hard Swapping  Hard swapping takes place when all of the following are true :  Atleast two processes are on the run queue, waiting for CPU.  The average free memory over 30 seconds is consistently less than minimum.  Excessive paging (page-out + page-in is high). 9/3/2012 18
  • 19. Pros and Cons of Swapping  Pros: 1.This is the inexpensive way to conserve memory. 2. Easy implementation.  Cons: 1. It dramatically affects a process’s performance. So the swapping is used only as a last resort when the system is desperate for memory. 9/3/2012 19
  • 20. Demand paging  The Demand paging model uses a page as the granularity for memory management.  Pages of memory are allocated on demand.  When memory is first referenced, a page fault occurs and memory is allocated one page at a time.  The page scanner and the virtual memory page fault mechanism are the core of the demand paged memory management. 9/3/2012 20
  • 21. Page Scanner  The page scanner is a kernel thread, which is awakened when the amount of memory on the free-page list falls below a system threshhold, typically 1/64 th of total physical memory.  Scanner (pageout_scanner) tracks pages by reading the state of the hardware bits in MMU – MMU bits maintain state of referenced and written (dirty). – Uses a twohanded clock algorithm to determine eviction. 9/3/2012 21
  • 22. Two Handed Clock Algorithm  Both hands rotate clock-wise.  The front hand clears the referenced and modified bit of each page.  The trailing back hand then inspects the referenced and modified bits some time later. 9/3/2012 22
  • 23. Scan Rate  The scan rate changes during the course of the page scanners operation  Scanners scans at slowscan when memory is below lotsfree and then increases to fastscan when memory has fallen below minfree threshold  Slowscan is set to 100 pages by default.  Fastscan is set to physicalmemory/2 capped at 8192 pages 9/3/2012 23
  • 24. Page Faults When do Page Faults occur?  MMU-generated exceptions (trap) tell the operating system when a memory access cannot continue without the kernel’s intervention.  Three major types of memory-related hardware exceptions can occur:  Major page faults  Minor page faults  Protection faults 9/3/2012 24
  • 25. Advantages of Demand paging  Loading pages of memory on demand dramatically lowers the memory footprint  Memory footprint refers to the amount of main memory that a program uses or references while running.  And startup time of the process. 9/3/2012 25
  • 26. Memory sharing Multiple users’ processes can share memory  Multiple processes can sharing program binaries and application data.  The Solaris kernel introduced dynamically linked libraries. 9/3/2012 26
  • 27. Memory protection  A user’s process must not be able access the memory of another process.  A program fault in one program could cause another program (or the entire operating system) to fail.  The protection is implemented by using protection modes read, write, execute and boundary checking. 9/3/2012 27
  • 28. Kernel Virtual Memory Layout  The kernel uses virtual memory and MMU like the process.  The kernel uses top 256 Mbytes or 512 Mbytes in common virtual address space.  Most of the kernel memory are not pageable.  This characteristics avoids the deadlocks.  The kernel cannot rely on the global paging. 9/3/2012 28
  • 29. Kernel Memory Allocation  Kernel memory is allocated at different levels.  Page allocator It allocates unmapped pages from the free list to the kernel address space. Solaris uses Resource map allocator to allocate the free memory to the kernel. Resource map allocator uses first-fit algorithm. 9/3/2012 29
  • 30. Kernel Memory Slab Allocator  Solaris provides a general-purpose memory allocator that provides arbitrarily sized memory allocations. We use the slab allocator for memory requests that are:  Smaller than a page size  Not an even multiple of a page size  Frequently going to be allocated and freed, so would otherwise fragment the kernel map 9/3/2012 30
  • 31. Why Slab Allocator?  The reasons for introducing the slab allocator were as follows:  The SVR4 allocator was slow to satisfy allocation requests.  Significant fragmentation problems arose with use of the SVR4 allocator.  The allocator footprint was large, wasting a lot of memory.  With no clean interfaces for memory allocation, code was duplicated in many places. 9/3/2012 31
  • 32. 9/3/2012 32
  • 33.  The slab allocator uses the term object to describe a single memory allocation unit.  Cache to refer to a pool of like objects.  Slab to refer to a group of objects that reside within the cache.  Slab allocator solves many of the fragmentation issues by grouping different sized memory objects.  Many cache will be activate at once in the solaris kernel. 9/3/2012 33
  • 34. References Book:  SOLARIS Internals,Core Kernel Architecture,Sun Microsystems. Website: www.sun.com 9/3/2012 34
  • 35. THANK YOU…. 9/3/2012 35