Repository navigation
List every process, not the first quarter - #34
Open
edward-mcnair wants to merge 1 commit into
Open
edward-mcnair wants to merge 1 commit into
edward-mcnair wants to merge 1 commit into
Conversation
proc_listallpids returns a count of PIDs, not bytes (libproc divides by sizeof(int) itself). Dividing it by sizeof(pid_t) again meant the process widget scanned only the first quarter of running processes, so it often missed the busiest ones. The buffer was also a fixed 1024 entries; it is now sized from the current count. The listing moves into ProcessMonitorService.allPIDs() so a test can check that it covers every running process, including the test's own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
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.
What does this PR do?
proc_listallpidsreturns a count of PIDs, not bytes: libproc divides bysizeof(int)itself.fetchRawSnapshots()divided it bysizeof(pid_t)again, so the process widget scanned only the first quarter of running processes and often missed the busiest ones. The buffer was also a fixed 1024 entries.ProcessMonitorService.allPIDs(), sized from the current count with headroom, and uses the count as returned.Tests:
ProcessListingTests: the listing covers at least three quarters of the system's own count (allowing for processes that start or exit in between) and includes the test's own PID.Screenshots
No UI change. The Top Processes widget simply finds processes it used to miss.
Checklist
swift-formatlint clean)🤖 Generated with Claude Code