Repository navigation
fix(broker): bound the squatter total by the card's used memory (#103) - #110
Merged
Merged
Conversation
On Windows a process's Dedicated Usage reading counts its committed reservation. The v0.3.2 cap bounds one process, but the sum could still pass what the driver says the card uses: dwm.exe read 11 GB on a 16 GB card reported at 15.5 GB used, and every sized berth run was refused. The squatter total that feeds admission, the contested-grant figure and the wait reason is now at most the card's used memory minus the baseline and what leases and claims really hold. An unknown used figure keeps the plain sum. Per-squatter entries keep their raw readings. The clamp logs once per change of state. Fixes #103.
# Conflicts: # CHANGELOG.md
This was referenced Oct 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #103, reported by @azrael-229.
On Windows the PDH
Dedicated Usagereading counts a process's committed reservation. The v0.3.2 cap (#82) bounds each process, but the sum could still pass what the driver says the card uses. In the report, dwm.exe read ~11 GB on a 16.3 GB card the driver showed at ~15.5 GB used, so every sizedberth runwas refused with "at most 0 MiB can be freed".min(sum, card used - baseline - what leases and claims really hold). It feeds admission, the contested-grant figure and the "squatters hold N MiB" reason. Lease and claim bytes are their measured per-process readings, not theirneedsbudgets.sum_mib,bound_mib), never per tick.Tests, with the issue's numbers: a 100 MiB probe is granted (red on main: the acquire never returns), a 2000 MiB request still waits with the bounded figure in its reason, a sum under the used figure is unchanged, and the log fires once per state change.
Proof: build, gofmt, vet,
go test ./...,-raceon the squatter tests, GOOS=windows build and vet, golangci-lint (0 issues).