Releases: zwajton/ZRAM-SWAP-Optimizer
ZRAM (SWAP) Optimizer
ZRAM-SWAP-Optimizer Release Notes
v4.0 (2025-10-04)
Features
Automatic ZRAM Sizing:
-
Detects device RAM and sets ZRAM size dynamically:
- 4GB RAM → 3GB ZRAM
- 6GB RAM → 5GB ZRAM
- 8GB RAM → 6GB ZRAM
- 12GB RAM → 8GB ZRAM
-
Compression Algorithm Selection:
Uses lz4 by default for fast compression (can be changed to zstd). -
Aggressive VM Tuning:
Applies and periodically reapplies optimal VM parameters for swap and memory management, including:- swappiness, page-cluster, vfs_cache_pressure, dirty ratios, and more.
- Logs both old and new values for transparency.
-
ZRAM Writeback Support:
Enables ZRAM writeback if supported by the kernel (with a 50MB limit). -
Fallback to Swapfile:
If ZRAM setup fails or is unsupported, automatically creates and enables a swapfile. -
Robust Logging:
Logs all actions, system info, and memory status to /sdcard/zram_optimizer.log for easy troubleshooting. -
Boot Delay & System Readiness:
Waits for system boot completion before running to ensure stability.
Improvements
- Live ZRAM Resize:
Attempts non-destructive ZRAM resizing before falling back to reset. - Periodic VM Tuning:
Reapplies VM settings every 5 minutes to prevent system overrides. - Detailed Logging:
Logs device model, kernel version, and memory stats before and after optimization.
Bug Fixes
- Ensures swapfile is cleaned up and recreated if needed.
- Handles missing or unsupported kernel features gracefully.