Skip to content

System Optimization

madkoding edited this page Mar 5, 2026 · 1 revision

System Optimization

madOS includes aggressive optimizations for low-RAM systems (1.9GB target).

ZRAM

Compressed swap using RAM:

  • Size: 50% of physical RAM
  • Algorithm: zstd (best compression ratio)
  • Priority: 100 (highest)
  • Type: swap

Configured via systemd-zram-generator:

/etc/systemd/zram-generator.conf

EarlyOOM

Out-of-memory killer that runs before the kernel OOM:

  • Prevents system freezes
  • Kills largest memory consumers first
  • Configured for responsive killing
systemctl status earlyoom

Kernel Tuning

Applied via /etc/sysctl.d/99-extreme-low-ram.conf:

Parameter Value Description
vm.swappiness 5 Minimal swap usage
vm.vfs_cache_pressure 200 Aggressive cache reclamation
vm.dirty_ratio 5 Quick writeback
vm.dirty_background_ratio 3 Background writeback
vm.min_free_kbytes 16384 Reserve 16MB free

Network Optimizations

  • Reduced TCP buffer sizes
  • Faster timeouts
  • Optimized for low-memory

Adaptive Rendering

madOS automatically detects hardware and adjusts:

Modern Hardware

  • Hardware-accelerated OpenGL/Vulkan
  • Full compositor features
  • Animations enabled

Legacy Hardware (<2GB RAM, old CPUs/GPUs)

  • Software rendering (pixman)
  • Reduced animations
  • Optimized for stability

Detection script:

detect-legacy-hardware

Services

Enabled by default:

  • earlyoom - Memory management
  • iwd - WiFi daemon
  • systemd-timesyncd - Time sync
  • NetworkManager - Network management
  • blueman - Bluetooth management

Boot Optimization

Plymouth

Graphical boot splash with silent mode.

Login

  • TTY1 autologin
  • Automatic compositor startup via .bash_profile

Performance Monitoring

# Check RAM usage
htop
free -h

# ZRAM status
zramctl

# Boot time analysis
systemd-analyze
systemd-analyze blame

Clone this wiki locally