27 Commits
Author SHA1 Message Date
lzrdblzzrd 203680a3d1 Game mode: drop a process after two low memory checks
A tracked game keeps its status through the first below-threshold scan and loses it on the second consecutive one; memory back at or above the threshold resets the wait. Mode stays on while any game remains.
3.0
2026-11-09 20:12:35 +03:00
lzrdblzzrd b8d4495898 README: drop obvious log sentence and extra dependency note 2026-11-09 19:51:37 +03:00
lzrdblzzrd 12446d1f3b README: restore behaviour and journal reference
Bring back the 'How it works' section and the list of journal message types; keep explanations and log sequencing out.
2026-11-09 19:50:03 +03:00
lzrdblzzrd e8ab4e5029 README: minimal quick start
Keep only purpose, build, flags, autostart and log path.
2026-11-09 19:48:44 +03:00
lzrdblzzrd ac67c3f140 README: keep only reader-facing information
Drop the journal message catalogue and log ordering example; describe purpose, thresholds, build, flags and autostart.
2026-11-09 19:46:30 +03:00
lzrdblzzrd ab62bf7006 README: rewrite for readers
Describe behavior, build, flags, journal and autostart without change-log commentary.
2026-11-09 19:43:09 +03:00
lzrdblzzrd 46f0637752 Log: use DD.MM.YYYY HH:MM:SS timestamps
Replace the Go default date/time prefix with a Russian-style local timestamp; README journal section updated.
2026-11-09 19:36:48 +03:00
lzrdblzzrd 88f37f7665 Log: drop block lines
Processes whose priority cannot be changed are still added to the blocklist, but the failure is no longer written to the log. README log contract updated.
2026-11-09 19:10:00 +03:00
lzrdblzzrd cb854eca01 Log: bracket game mode transitions
Name the process that opens game mode, keep the game first in the set block, and close the block with 'game mode enabled'. Log 'disabling game mode' before restores and 'game mode disabled' after them; the opening marker is not repeated while a restore is retried. Update README log contract.
2026-11-09 19:04:58 +03:00
lzrdblzzrd 48934dc917 Rewrite: compact log, tracked restore errors, tests 2026-11-08 21:52:26 +03:00
lzrdblzzrd 4f8f6218ad Rewrite: improve process handling and restoration 2026-08-08 14:08:38 +03:00
lzrdblzzrd bf37dd6974 Update README: fix defaults (game-mem=2G), remove SKIP RESTORE, add GAME DETECT, update game mode description 2.0 2026-06-23 11:20:55 +03:00
lzrdblzzrd 0e8d7333c1 Rewrite: simplify to strict algorithm, remove promoted map
- Remove promoted map entirely — processes are demoted when RSS < -mem
  and promoted when RSS >= -mem, no permanent state
- Remove trySetPrio closure — use setPrio directly for simplicity
- Remove curPrioWithHandle helper — inline procGetPriority.Call
- Remove GAME ... tracked as game (blocked) repeated log — log once
  on detection via GAME DETECT, silently skip on subsequent scans
- Game mode: log GAME DETECT once when process first exceeds game-mem
- gameSaved stores original priority before IDLE demote, restores on
  GAME MODE OFF or shutdown
- Delay between priority changes: 100ms
- Delete TZ.md (was a test for other AI)
2026-06-23 11:16:51 +03:00
lzrdblzzrd da13a6d549 Demote promoted processes when RSS drops below threshold
Previously, once a process was promoted to HIGH, it stayed HIGH forever
even if its RSS dropped well below the -mem threshold. Now promoted
processes are demoted back to NORMAL when RSS < -mem, and removed from
the promoted map.

Also: added TZ.md with full technical specification of the project.
2026-06-23 08:58:11 +03:00
lzrdblzzrd ea914101bb Fix: blocked processes still measured for game-mem detection
Previously, when SetPriorityClass failed for a process (e.g. anti-cheat),
it was added to 'blocked' and completely skipped in future scans —
including RSS measurement. This meant a game that started below game-mem
threshold and got blocked before reaching it would never trigger game mode.

Now pass 1 measures RSS for ALL processes (including blocked ones) and
adds them to gameProcs if they exceed game-mem. Pass 2 skips priority
changes for blocked processes but still tracks them as game processes.

In game mode, blocked game procs log 'tracked as game (blocked)' instead
of trying SetPriorityClass again.
2026-06-22 17:41:10 +03:00
lzrdblzzrd 565b751195 Rewrite game mode: two-pass scan, priority restoration, LimitedInformation access
- Use PROCESS_QUERY_LIMITED_INFORMATION instead of PROCESS_QUERY_INFORMATION
  to open processes (fixes Access Denied for KeePassXC, HD-Player, etc.)
- Separate query handle from set handle: trySetPrio reopens with
  PROCESS_SET_INFORMATION only when needed
- Two-pass scan: pass 1 collects RSS and detects game processes,
  pass 2 applies priorities with correct hasGame state
- Game mode saves original priorities in gameSaved map, restores them
  on GAME MODE OFF (not just NORMAL)
- Demote ALL non-game processes to IDLE in game mode (not just promoted)
- 50ms delay between priority changes for smooth transitions
- Replace isAlive/procName with pidMap from allProcs snapshot
- Replace mutex/MessageBox single-instance with killOtherInstances
- Defaults: -mem=512M, -game-mem=4G
- Fix double CloseHandle and handle leak in trySetPrio
- Update README with new defaults and game mode restoration behavior
2026-06-22 17:24:21 +03:00
lzrdblzzrd b5885791fa Fix process entry struct, add demote logic, block protected processes, improve logging 2026-06-21 15:11:15 +03:00
lzrdblzzrd d4da33ca5e fix: ErrorAlreadyExists 1832->183, wrap syscall errors, signal handling, mutex cleanup, log sync 2026-06-20 23:41:59 +03:00
lzrdblzzrd 33dfd4b4c5 fix: processEntry32 DefaultHeapID uint32 instead of uintptr 2026-06-19 23:24:01 +03:00
lzrdblzzrd b999b7ec4f refactor: error handling, single rss call, stale PID cleanup, utf16 trim, O_APPEND log 2026-06-19 23:20:10 +03:00
lzrdblzzrd d0cafe1332 log: move log file to temp directory with fallback 2026-06-19 21:39:45 +03:00
lzrdblzzrd c3cb8ae847 rewrite: single file, zero deps, Windows API, logging, CLI flags 2026-06-19 21:37:01 +03:00
lzrdblzzrd c8648da296 updated with opencode 2026-06-17 02:15:43 +03:00
lzrdblzzrd 0b714dd3ef added a check for a running instance of the program 1.1 2023-01-15 16:08:01 +03:00
lzrdblzzrd 39030102b4 go.sum has been cleaned up 1.0 2023-01-15 09:55:58 +03:00
lzrdblzzrd 6e1d1da239 initial commit 2023-01-15 03:28:39 +03:00
lzrdblzzrd 0876ff81db Initial commit 2023-01-15 03:25:23 +03:00