1

Update README: fix defaults (game-mem=2G), remove SKIP RESTORE, add GAME DETECT, update game mode description

This commit is contained in:
2026-06-23 11:20:55 +03:00
parent 0e8d7333c1
commit bf37dd6974
+6 -6
View File
@@ -22,7 +22,7 @@ Every scan interval the program iterates over all running processes:
When any process reaches or exceeds the `-game-mem` threshold:
1. That process → **HIGH** (logged as `GAME`)
2. All other processes → **IDLE**
2. All other processes → **IDLE** (original priorities saved)
3. Log: `GAME MODE ON`
When all such processes close:
@@ -31,9 +31,9 @@ When all such processes close:
2. `GAME MODE OFF` logged
3. Normal mode resumes — priorities recalculated by `-mem` rules
If `SetPriorityClass` or `OpenProcess` fails for a process (e.g., anti-cheat protection, system processes), the process is added to an in-memory exclusion list and never touched again (logged as `BLOCK`). When the process exits, it is automatically removed from the list.
If `SetPriorityClass` or `OpenProcess` fails for a process (e.g., anti-cheat protection, system processes), the process is added to an in-memory exclusion list and never touched again (logged as `BLOCK`). Blocked processes are still measured for RSS each scan — if a blocked process exceeds `-game-mem`, it triggers game mode without attempting to change its priority. When the process exits, it is automatically removed from the list.
On shutdown, all processes are restored: game-mode demoted processes to their saved original priority, promoted and game processes to NORMAL.
On shutdown, all processes demoted during game mode are restored to their saved original priority.
## Build
@@ -56,7 +56,7 @@ autopriority [flags]
| Flag | Default | Description |
|-------------|---------------|----------------------------------|
| `-mem` | 512M | Memory threshold (e.g. 512M, 1G, 2048M) |
| `-game-mem` | 4G | Game threshold (e.g. 3G, 4G). Must be > `-mem`. 0 = disabled |
| `-game-mem` | 2G | Game threshold (e.g. 2G, 4G). Must be > `-mem`. 0 = disabled |
| `-interval` | 1 minute | Scan interval (min 10s) |
| `-dry-run` | false | Log only, don't change priority |
@@ -66,7 +66,7 @@ Examples:
# Run with 1 GB threshold, scanning every 30 seconds
autopriority -mem=1G -interval=30s
# Run with defaults (512M threshold, 4G game threshold)
# Run with defaults (512M threshold, 2G game threshold)
autopriority
# Game mode: normal threshold 512M, game threshold 4G
@@ -86,12 +86,12 @@ Log entries:
|---|---|
| `PROMOTE` | Priority raised to HIGH (normal mode) |
| `DEMOTE` | Priority lowered to NORMAL (normal mode) |
| `GAME DETECT` | Process first detected as exceeding game-mem threshold |
| `GAME` | Process set to HIGH or IDLE (game mode) |
| `GAME MODE ON` | Game mode activated |
| `GAME MODE OFF` | Game mode deactivated — processes restored |
| `BLOCK` | OpenProcess or SetPriorityClass failed; process added to exclusion list |
| `RESTORE` | Process restored to original/saved priority (game mode exit or shutdown) |
| `SKIP RESTORE` | PID reused by a different process; restore skipped |
| `[DRY-RUN]` | Would change priority (dry-run mode) |
## Auto-start