d4da33ca5ec47c06c838b9ac33b2741e9938be53
autoPriority
Automatically sets high CPU priority for processes exceeding a memory threshold.
Windows only.
Build
Requires Go 1.26+.
# Standard build (with console window)
go build -o autopriority.exe .
# Background build (no console, minimal size)
go build -ldflags="-H windowsgui -s -w" -o autopriority.exe .
Usage
autopriority [flags]
| Flag | Default | Description |
|---|---|---|
-mem |
536870912 | Memory threshold in bytes (512 MB) |
-interval |
1 minute | Scan interval (min 10s) |
-dry-run |
false | Log only, don't change priority |
Examples:
# Run with 1 GB memory threshold, scanning every 30 seconds
autopriority -mem=1073741824 -interval=30s
# Dry run — log decisions without changing anything
autopriority -dry-run
Log is always written to %TEMP%\autopriority.log.
Auto-start
Open Win+R, type shell:startup, and press Enter. Then place a shortcut to autopriority.exe in the folder that opens.
Dependencies
None. Uses only Windows API (kernel32, psapi) via raw syscall.
Description
Languages
Go
100%