-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yaml
More file actions
125 lines (95 loc) · 6.29 KB
/
config.yaml
File metadata and controls
125 lines (95 loc) · 6.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Universal Memory Optimizer Configuration
# Edit this file to customize behavior
#───────────────────────────────────────────────────────────────────────────────
# ARCHITECTURE
#───────────────────────────────────────────────────────────────────────────────
# Memory sizing ratios (percentage of RAM)
architecture:
# ZRAM size as percentage of RAM (default: 50 = RAM/2)
zram_ratio: 50
# Swapfile size as percentage of RAM (default: 25 = RAM/4 = ZRAM/2)
swapfile_ratio: 25
# Examples:
# 32GB RAM → 16GB ZRAM → 8GB Swapfile
# 16GB RAM → 8GB ZRAM → 4GB Swapfile
# 8GB RAM → 4GB ZRAM → 2GB Swapfile
# 4GB RAM → 2GB ZRAM → 1GB Swapfile
#───────────────────────────────────────────────────────────────────────────────
# ZRAM CONFIGURATION
#───────────────────────────────────────────────────────────────────────────────
zram:
# Compression algorithm
# Options: zstd (best ratio), lz4 (fastest), lzo-rle (balanced)
algorithm: zstd
# Swap priority (higher = used first)
priority: 100
#───────────────────────────────────────────────────────────────────────────────
# SWAPFILE CONFIGURATION
#───────────────────────────────────────────────────────────────────────────────
swapfile:
# Path to swapfile
path: /swapfile
# Swap priority (lower than ZRAM)
priority: 10
# Protect hibernate configuration
# If true, won't modify swapfile if hibernate is configured
hibernate_protection: true
#───────────────────────────────────────────────────────────────────────────────
# KERNEL PARAMETERS (SYSCTL)
#───────────────────────────────────────────────────────────────────────────────
sysctl:
# How aggressively to use swap (0-200)
# For ZRAM: 180 is optimal
# Source: ArchWiki, Pop!_OS, ChromeOS
swappiness: 180
# Pages to read at once from swap (2^n pages)
# 0 = single page, optimal for ZRAM
# Source: ChromeOS, Android defaults
page_cluster: 0
# How aggressively to reclaim dentry/inode caches
# Lower = keep caches longer (better for responsiveness)
vfs_cache_pressure: 50
# When to wake kswapd (fraction of 10000)
# Higher = earlier, smoother memory management
watermark_scale_factor: 125
# Disable watermark boosting
watermark_boost_factor: 0
# Dirty page ratios
dirty_ratio: 10
dirty_background_ratio: 5
#───────────────────────────────────────────────────────────────────────────────
# OOM HANDLING
#───────────────────────────────────────────────────────────────────────────────
# OOM policy is NOT configured by this optimizer.
# The 3-tier swap system (RAM → ZRAM → Swapfile) should handle most scenarios.
# When all swap is exhausted, the kernel's default OOM killer will handle it.
# This prevents potential deadlocks from custom OOM policies.
#───────────────────────────────────────────────────────────────────────────────
# BOOTLOADER
#───────────────────────────────────────────────────────────────────────────────
bootloader:
# Detection mode: auto | grub | systemd-boot | uki | skip
detection: auto
# ZSWAP disable (required for ZRAM)
disable_zswap: true
#───────────────────────────────────────────────────────────────────────────────
# BACKUP & LOGGING
#───────────────────────────────────────────────────────────────────────────────
backup:
# Backup directory
directory: /root/memory-optimizer-backups
# Keep last N backups (0 = keep all)
retention: 5
logging:
# Log level: quiet | normal | verbose | debug
level: normal
# Generate diagnostic reports
reports_enabled: true
reports_directory: /root/memory-optimizer-reports
#───────────────────────────────────────────────────────────────────────────────
# VERIFICATION
#───────────────────────────────────────────────────────────────────────────────
verification:
# Create verification script after installation
create_script: true
script_path: /usr/local/bin/memory-optimizer-verify