Linux Tutorials - Herong's Tutorial Examples
∟Memory Management
This chapter provides introductions and tutorial notes on memory management. Topics include memory layers and access speed; cache memory levels; virtual memory and physical memory mapping; page table; buffers, caches and swap spaces; memory usage reporting tools: free, ps, smem, pmap, /proc/meminfo, /proc/{id}/maps, and /proc/{id}/smaps.
Layers of Memory and Access Speed
List CPU Caches and Their Sizes
Virtual Memory vs. Physical Memory
Buffer Memory and Cache Memory
Verify Cache Memory with "cp" Command
What Is Swap Space
Virtual Memory Mapping and Page Table
"ps -o rss,drs,trs,vsz,sz" - Process Status Options
smem - Process Memory Usage Report
pmap - Process Memory Map
/proc/{id}/maps - Process Memory Map
/proc/{id}/smaps - Process Memory Map Details
Takeaways:
- Virtual memory is a logical structure mapped to physical memory dynamically.
- Swap space is a reserved area on hard disk to extend RAM to form a larger physical memory.
- "free" command prints a summary of physical memory usage.
- "/proc/meminfo" pseudo file contains detailed information on physical memory usage.
- Virtual memory is divided into pages and mapped to the physical memory
through a page table.
- "ps -o rss,drs,trs,vsz,sz" command lists all process with their memory usages.
- "smem" tool lists all process with their memory usages.
- "pmap {pid}" command prints memory map for a given process.
- "/proc/{pid}/maps" pseudo file contains memory map for each process.
- "/proc/{pid}/smaps" pseudo file contains memory map for each process with details.
Table of Contents
About This Book
Introduction to Linux Systems
Cockpit - Web Portal for Administrator
Process Management
►Memory Management
Files and Directories
Users and Groups
File Systems
Block Devices and Partitions
LVM (Logical Volume Manager)
Installing CentOS
SELinux - Security-Enhanced Linux
Network Connection on CentOS
Internet Networking Tools
SSH Protocol and ssh/scp Commands
Software Package Manager on CentOS - DNF and YUM
vsftpd - Very Secure FTP Daemon
LDAP (Lightweight Directory Access Protocol)
Administrative Tasks
References
Full Version in PDF/EPUB