
Plugging you into Tech. Daily Tech news in South Africa ๐ฟ๐ฆ and World Wide. Let's talk Tech ๐ป ๐ฅ
127.0.0.1
Joined May 2022
- Tweets528
- Following814
- Followers103
- Likes19.6K
Tech Plug ZA retweeted
๐๏ธ Hired in Tech: Tech Career Development from an HR and Recruiter Perspective
๐
Wednesday, 24 June 2026
โฐ 6:30 PM SAST
๐ป Online Fireside Chat: lnkd.in/d4EhgMmk
๐ค Hosted by Tshilidzi Mavhunga
Meet our Moderator, Tshilidzi Mavhunga.
#HiredInTech #womenintech
Tech Plug ZA retweeted
Not for vibe-coders, they started with a full blown e-commerce platform with a supabase backend and 8 microservices
This post is unavailable. Learn more
Tech Plug ZA retweeted
MEMORY MANAGEMENT IN LINUX
Memory Management is a core responsibility of the Linux kernel
โ controls how memory is allocated and used
โ ensures efficient multitasking
โ isolates processes for security and stability
The Linux kernel manages both
โ Physical Memory (RAM)
โ Virtual Memory
WHAT IS MEMORY MANAGEMENT?
Application Starts
โ requests memory from kernel
โ kernel allocates required memory space
Kernel Responsibilities
โ allocate memory
โ free unused memory
โ manage virtual memory
โ protect process memory spaces
Goal
โ maximize performance and efficiency
PHYSICAL MEMORY (RAM)
RAM
โ stores actively running programs and data
Linux divides RAM into
โ Kernel Space
โ User Space
Kernel Space
โ reserved for kernel operations
User Space
โ used by applications and processes
VIRTUAL MEMORY
Linux uses Virtual Memory
โ each process gets its own virtual address space
Advantages
โ process isolation
โ larger usable memory space
โ improved security
Flow
Application
โ Virtual Address
โ MMU (Memory Management Unit)
โ Physical Address in RAM
MEMORY PAGING
Linux divides memory into fixed-size pages
Page
โ small block of memory (commonly 4 KB)
Paging Process
Virtual Memory
โ divided into pages
Kernel
โ maps pages to physical memory
Benefits
โ efficient memory allocation
โ easier swapping
โ reduced fragmentation
SWAPPING
When RAM becomes full
โ inactive pages moved to swap space on disk
Flow
RAM Full
โ Kernel selects inactive pages
โ moves them to Swap Partition/File
โ frees RAM for active processes
Purpose
โ prevent system crashes
โ support more processes than physical RAM alone
PAGE CACHE
Linux uses free RAM as cache
Disk Data
โ stored temporarily in RAM
Benefits
โ faster file access
โ reduced disk I/O
Flow
Application Requests File
โ kernel checks page cache
โ if found โ return immediately
โ otherwise read from disk
SLAB ALLOCATOR
Kernel frequently allocates small objects
Slab Allocator
โ pre-allocates memory caches
โ improves allocation speed
Examples
โ process descriptors
โ file objects
โ network buffers
Benefits
โ reduced fragmentation
โ faster kernel performance
MEMORY STATES
Free Memory
โ available for allocation
Used Memory
โ currently allocated
Cached Memory
โ temporary storage for faster access
Buffered Memory
โ used for I/O buffering
Swap Memory
โ disk-based extension of RAM
OUT OF MEMORY (OOM) HANDLER
When system runs out of memory
โ Linux activates OOM Killer
OOM Killer
โ selects high-memory-consuming processes
โ terminates them to recover memory
Purpose
โ keep system operational
MEMORY PROTECTION
Each process has isolated memory space
Process A
โ cannot directly access Process B memory
Kernel
โ enforces permissions and isolation
Benefits
โ security
โ stability
โ crash prevention
MEMORY MANAGEMENT FLOW
Application
โ requests memory
Kernel
โ allocates virtual memory
MMU
โ translates addresses
RAM
โ stores active pages
Inactive Pages
โ moved to swap if needed
Kernel
โ reclaims memory when process exits
IMPORTANT LINUX MEMORY COMMANDS
free
โ displays memory usage
top / htop
โ monitor RAM consumption
vmstat
โ virtual memory statistics
swapon
โ manage swap space
cat /proc/meminfo
โ detailed memory information
KEY BENEFITS
Efficient Resource Usage
โ optimized RAM utilization
Process Isolation
โ secure multitasking
Performance Optimization
โ caching and paging improve speed
Scalability
โ supports systems from embedded devices to servers
SUMMARY
Linux Memory Management
โ allocates
โ tracks
โ protects
โ optimizes system memory
Core Components
โ virtual memory
โ paging
โ swap
โ page cache
โ slab allocator
Together
โ provide fast, stable, and scalable system performance
โ Get the Linux Mastery Ebook:
codewithdhanian.gumroad.com/โฆ



























