SlideShare a Scribd company logo
1 of 11
Cache Memory
&
Virtual Memory
Prakhar Bansal 19CSU215
Table of Contents
• Cache Memory
• Functioning of Cache Memory
• Types of Cache Memory
• Application of Cache Memory
• Virtual Memory
• Functioning of Virtual Memory
• Types of Virtual Memory
• Application of Virtual Memory
Cache
Memory
Cache memory is an extremely
fast memory type that acts as a
buffer between RAM and the
CPU. It holds frequently
requested data and instructions
so that they are immediately
available to the CPU when
needed.
Cache memory is used to
reduce the average time to
access data from the Main
memory.
Functioning of
Cache Memory
Whenever the CPU wants to access memory, it first checks whether what
it needs resides in the cache memory. If yes, it would be able to access it
with the least latency. If it does not reside in cache, then the requested
content would be copied from RAM to the cache and then only the CPU
will access it from the cache. Here, when copying content from the cache,
not only the content in the requested memory address but also the
nearby content is copied to cache. So, the next time there is a high
probability for a cache hit to occur as most computer programs access
nearby data or last accessed data most of the times. So due to the cache,
the average memory latency is reduced.
Types of Cache
• Primary Cache –
A primary cache is always located on the
processor chip. This cache is small and its
access time is comparable to that of
processor registers.
• Secondary Cache –
Secondary cache is placed between the
primary cache and the rest of the
memory. It is referred to as the level 2
(L2) cache. Often, the Level 2 cache is
also housed on the processor chip.
Applications of
Cache Memory
• Usually, the cache memory can store a reasonable
number of blocks at any given time, but this number
is small compared to the total number of blocks in
the main memory.
• The correspondence between the main memory
blocks and those in the cache is specified by a
mapping function.
Virtual Memory
Virtual memory is a memory management technique
where secondary memory can be used as if it were a part
of the main memory. Virtual memory is a very common
technique used in the operating systems (OS) of
computers.
Functioning of
Virtual Memory
When a program is started, it is given a virtual address
space that can be even larger than the actual physical
memory. Virtual memory space is also divided into
chunks called pages and each of this virtual memory
page can be mapped to a physical page. The table called
page table keep track of this mapping. When the
physical memory runs out of space, what is done is,
certain physical pages are pushed to that special
portion in the hard disk. When any page pushed to the
hard disk is needed again, it is brought to the physical
memory by putting another selected page from the
physical memory to the hard disk.
Types of Virtual Memory
• Paged Virtual Memory : Paging divides memory into sections or paging files, usually
approximately 4 KB in size. When a computer uses up its RAM, pages not in use are
transferred to the section of the hard drive designated for virtual memory using a swap file.
• Segmented Virtual Memory : Segmentation is also used to manage virtual memory.
This approach divides virtual memory into segments of different lengths. Segments not in use
in memory can be moved to virtual memory space on the hard drive. Segmented information or
processes are tracked in a segment table, which shows if a segment is present in memory,
whether it's been modified and what its physical address is.
Applications of Virtual Memory
• Increases security because of memory isolation.
• Frees applications from managing shared memory and saves users from having to
add memory modules when RAM space runs out.
• Multiple larger applications can be run simultaneously.
• We can allocate memory really cheap
THANK YOU

More Related Content

What's hot

Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stackAsif Iqbal
 
Random access memory
Random access memoryRandom access memory
Random access memoryRuchi Maurya
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)Sandesh Jonchhe
 
The CPU and Memory and Major Components
The CPU and Memory and  Major ComponentsThe CPU and Memory and  Major Components
The CPU and Memory and Major Componentsimtiazalijoono
 
Primary memory (main memory)
Primary memory (main memory)Primary memory (main memory)
Primary memory (main memory)shah baadshah
 
ROM (Read Only Memory)
ROM (Read Only Memory)ROM (Read Only Memory)
ROM (Read Only Memory)JaneAlamAdnan
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Cache memory principles
Cache memory principlesCache memory principles
Cache memory principlesbit allahabad
 
Computer registers
Computer registersComputer registers
Computer registersDeepikaT13
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 

What's hot (20)

Cache memory
Cache memoryCache memory
Cache memory
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stack
 
Random access memory
Random access memoryRandom access memory
Random access memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)
 
The CPU and Memory and Major Components
The CPU and Memory and  Major ComponentsThe CPU and Memory and  Major Components
The CPU and Memory and Major Components
 
Primary memory (main memory)
Primary memory (main memory)Primary memory (main memory)
Primary memory (main memory)
 
ROM (Read Only Memory)
ROM (Read Only Memory)ROM (Read Only Memory)
ROM (Read Only Memory)
 
Cache memory
Cache  memoryCache  memory
Cache memory
 
Cache memory
Cache memory Cache memory
Cache memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Cache memory principles
Cache memory principlesCache memory principles
Cache memory principles
 
Cache memory
Cache memoryCache memory
Cache memory
 
DMA and DMA controller
DMA and DMA controllerDMA and DMA controller
DMA and DMA controller
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer registers
Computer registersComputer registers
Computer registers
 
Memory mapping
Memory mappingMemory mapping
Memory mapping
 
Mapping
MappingMapping
Mapping
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 

Similar to Cache memory and virtual memory

Ppt cache vs virtual memory without animation
Ppt cache vs virtual memory without animationPpt cache vs virtual memory without animation
Ppt cache vs virtual memory without animationanimesh jain
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryAshik Iqbal
 
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
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managmentSantu Kumar
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 
Chapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptChapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptMonirJihad1
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.pptPratikBose10
 
Introduction to memory management
Introduction to memory managementIntroduction to memory management
Introduction to memory managementSweety Singhal
 

Similar to Cache memory and virtual memory (20)

Ppt cache vs virtual memory without animation
Ppt cache vs virtual memory without animationPpt cache vs virtual memory without animation
Ppt cache vs virtual memory without animation
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache Memory
 
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
 
Linux%20 memory%20management
Linux%20 memory%20managementLinux%20 memory%20management
Linux%20 memory%20management
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Memory management
Memory managementMemory management
Memory management
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managment
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 
Chapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.pptChapter 09 - Virtual Memory.ppt
Chapter 09 - Virtual Memory.ppt
 
virtual memory - Computer operating system
virtual memory - Computer operating systemvirtual memory - Computer operating system
virtual memory - Computer operating system
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
Cache memory
Cache memoryCache memory
Cache memory
 
Unit 5-lecture-2
Unit 5-lecture-2Unit 5-lecture-2
Unit 5-lecture-2
 
Cache memory presentation
Cache memory presentationCache memory presentation
Cache memory presentation
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
Introduction to memory management
Introduction to memory managementIntroduction to memory management
Introduction to memory management
 

Recently uploaded

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 

Recently uploaded (20)

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 

Cache memory and virtual memory

  • 2. Table of Contents • Cache Memory • Functioning of Cache Memory • Types of Cache Memory • Application of Cache Memory • Virtual Memory • Functioning of Virtual Memory • Types of Virtual Memory • Application of Virtual Memory
  • 3. Cache Memory Cache memory is an extremely fast memory type that acts as a buffer between RAM and the CPU. It holds frequently requested data and instructions so that they are immediately available to the CPU when needed. Cache memory is used to reduce the average time to access data from the Main memory.
  • 4. Functioning of Cache Memory Whenever the CPU wants to access memory, it first checks whether what it needs resides in the cache memory. If yes, it would be able to access it with the least latency. If it does not reside in cache, then the requested content would be copied from RAM to the cache and then only the CPU will access it from the cache. Here, when copying content from the cache, not only the content in the requested memory address but also the nearby content is copied to cache. So, the next time there is a high probability for a cache hit to occur as most computer programs access nearby data or last accessed data most of the times. So due to the cache, the average memory latency is reduced.
  • 5. Types of Cache • Primary Cache – A primary cache is always located on the processor chip. This cache is small and its access time is comparable to that of processor registers. • Secondary Cache – Secondary cache is placed between the primary cache and the rest of the memory. It is referred to as the level 2 (L2) cache. Often, the Level 2 cache is also housed on the processor chip.
  • 6. Applications of Cache Memory • Usually, the cache memory can store a reasonable number of blocks at any given time, but this number is small compared to the total number of blocks in the main memory. • The correspondence between the main memory blocks and those in the cache is specified by a mapping function.
  • 7. Virtual Memory Virtual memory is a memory management technique where secondary memory can be used as if it were a part of the main memory. Virtual memory is a very common technique used in the operating systems (OS) of computers.
  • 8. Functioning of Virtual Memory When a program is started, it is given a virtual address space that can be even larger than the actual physical memory. Virtual memory space is also divided into chunks called pages and each of this virtual memory page can be mapped to a physical page. The table called page table keep track of this mapping. When the physical memory runs out of space, what is done is, certain physical pages are pushed to that special portion in the hard disk. When any page pushed to the hard disk is needed again, it is brought to the physical memory by putting another selected page from the physical memory to the hard disk.
  • 9. Types of Virtual Memory • Paged Virtual Memory : Paging divides memory into sections or paging files, usually approximately 4 KB in size. When a computer uses up its RAM, pages not in use are transferred to the section of the hard drive designated for virtual memory using a swap file. • Segmented Virtual Memory : Segmentation is also used to manage virtual memory. This approach divides virtual memory into segments of different lengths. Segments not in use in memory can be moved to virtual memory space on the hard drive. Segmented information or processes are tracked in a segment table, which shows if a segment is present in memory, whether it's been modified and what its physical address is.
  • 10. Applications of Virtual Memory • Increases security because of memory isolation. • Frees applications from managing shared memory and saves users from having to add memory modules when RAM space runs out. • Multiple larger applications can be run simultaneously. • We can allocate memory really cheap