Memory

2025. 7. 25. 00:23·Computer Science/Operating System

 

Memory refers to a device in electronic circuits that records data, state, or instructions.

It is categorized into different types based on speed, volatility, and capacity:

 

 

1. Register

  • Located inside the CPU — smallest and fastest memory.
  • Volatile
  • Fastest speed
  • Smallest storage capacity

2. *Cache

  • Refers to L1, L2 cache.
  • Volatile
  • Very fast speed
  • Small storage capacity

3. Main Memory

  • Typically refers to RAM.
  • Volatile
  • Moderate speed
  • Moderate storage capacity

4. Secondary Storage

  • Includes HDD, SSD.
  • Non-volatile
  • Slowest speed
  • Largest storage capacity

 

 

Detail about *cache

The word cache is derived from the French word cacher, meaning "to hide," and refers to a place used to temporarily store or keep things.

 

Cache is

  • A temporary storage where data is pre-copied,
  • And a type of memory used to reduce bottlenecks caused by speed differences between fast and slow devices.

In practice, the speed gap between memory and CPU is very large,

so a register layer is placed in between to solve this speed difference.

The caching layer is the layer between such memory hierarchy layers designed to solve the speed gap.

 

 

Bottleneck Flow

  • The CPU constantly exchanges data with memory to process data.
  • The memory cannot keep up with the CPU's data processing speed.
  • This causes a bottleneck where the CPU must wait for memory.

To mitigate this bottleneck, a small but fast cache memory is placed between the CPU and the main memory.

It stores copies of data expected to be reused soon, allowing the CPU to access requested data immediately.

However, cache memory is expensive to use in large capacity or as main memory.

Main memory typically uses DRAM, while cache memory uses SRAM.

SRAM cells have more transistors and occupy more physical space.

 

 

Purpose of Memory Hierarchy

The goal is to use caching to combine small, fast memory with large, slow memory so they behave like a large, fast memory.

 

How do we know which data is likely to be reused?

We use the principle of data locality:

  • Data access happens close together in time (temporal locality) or space (spatial locality).
  • A variable referenced once is likely to be referenced again shortly after.
  • When accessing certain data, nearby data is also likely to be accessed.

Important Note

Because caching uses copies of data, differences between the copy and original may occur. Maintaining consistency is important.


Conclusion

Caching stores copies of data or computed results to improve overall processing speed when:

  • Direct access to data takes a long time,
  • You want to skip recalculating needed values,
  • The same results are repeatedly returned (e.g., images or thumbnails).

'Computer Science > Operating System' 카테고리의 다른 글

Process  (0) 2025.07.30
How memory manages data  (0) 2025.07.27
Components of a computer  (0) 2025.07.22
Structure of the Operating System  (0) 2025.07.19
What is an operating system?  (0) 2025.07.16
'Computer Science/Operating System' 카테고리의 다른 글
  • Process
  • How memory manages data
  • Components of a computer
  • Structure of the Operating System
JTB
JTB
웹/앱 개발 정보를 공유하고 있습니다.
  • JTB
    JTechBlog
    JTB
  • 전체
    오늘
    어제
    • All About Programming;) N
      • Computer Science
        • Terminology and Concepts
        • Network
        • Operating System
        • Database
        • Data Structure
      • Frontend
        • Javascript Essentials
        • Perfomance Optimization
        • JS Patterns
        • Next.js
        • Flutter
      • Backend
        • Node.js
      • DevOps
        • Docker & Kubernetes
      • Coding Test N
        • LeetCode N
        • Programmers
      • Tech Books & Lectures
        • Javascript_Modern JS Deep d..
        • Network_IT 엔지니어를 위한 네트워크 입문
      • Projects
        • PolyLingo_2025
        • Build Your Body_2024
        • JStargram_2021
        • Covid19 Tracker_2021
        • JPortfolio_2021
      • BootCamp_Codestates
        • TIL
        • TILookCloser
        • Pre Tech Blog
        • IM Tech Blog
        • Daily Issues and DeBugging
        • First Project
        • Final Project
        • Sprint Review
        • Good to Know
        • Socrative Review
        • HTML & CSS
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 글쓰기
    • 관리
  • 공지사항

  • 인기 글

  • 태그

    indie hacker
    스코프
    Time complexity and Space complexity
    커리어
    모던 자바스크립트 Deep Dive
    testing
    DOM
    VoiceJournal
    leetcode
    structure of os
    Data Structure
    Binary Tree BFS
    js pattern
    Threads and Multithreading
    need a database
    Shared resources
    Network
    polylingo
    JavaScript
    TCP/IP
    딥다이브
    자바스크립트
    How memory manage data
    mobile app
    Operating System
    CPU scheduling algorithm
    프론트엔드 성능 최적화 가이드
    database
    자바스크립트 딥다이브
    이벤트
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
JTB
Memory
상단으로

티스토리툴바