Inspecting and Optimizing Memory Usage in Linux
summary
Practical methods for tight-RAM devices: tests run on i.MX93 EVK with 2 GB RAM show the page struct uses ~64 bytes so representing 2 GB costs ~32 MB, and removing unneeded features (filesystems, IPv6, graphics, unused drivers) plus size-tuned compiler flags cuts the kernel from ~32 MB to 11 MB. Process-level accounting uses smem/smaps to get USS and PSS (avoid double-counting shared pages), leak hunting uses valgrind/--asan and a Python plotter, and limits via mem= kernel command line; stable limit 64 MB, 40 MB unstable.
AI-written summary · about
chapters (11)
- 0:00Memory optimization intro
- 1:05Virtual memory basics
- 5:47NUMA and memory zones
- 11:30Kernel memory analysis
- 17:11User space memory metrics
- 22:18System memory with free
- 24:29Kernel binary optimization
- 26:21Memory leak detection
- 30:21Swap and zram
- 33:14OOM killer tuning
- 35:20Q&A
related talks
26mLet's demystify memory
41mLies Programmers Believe about Memory
39mMM101: Introduction to Linux Memory Management
41mAre you out of memory, or have plenty to spare?
20mOptimizing Checkpoints with Built-in Memory Page Compression
48mPersistent Memory Usage within Linux Environment
01h 36mLinux Memory Management and Containers
46mHighmem deprecation planning
