Skip to content

Report RSS and the commit charge on Windows - #552

Merged
hsbt merged 2 commits into
mainfrom
claude/frosty-einstein-9209d8
Oct 29, 2026
Merged

hsbt merged 2 commits into
mainfrom
claude/frosty-einstein-9209d8

Conversation

@hsbt

@hsbt hsbt commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

On Windows, rss, maxrss and the RSS samples taken after each iteration are always 0, because there is no /proc, ps or getrusage to read them from.

This reports the working set and its peak from GetProcessMemoryInfo as RSS and MAXRSS. It also records the commit charge and its peak as commit_charge and peak_commit_charge, since private allocations on Windows show up there more than in the working set.

Only the benchmark process can read these between iterations and after its final GC, so this lives in the harness. The code is in lib/harness/windows_memory_counters.rb, which only Windows requires, so other platforms load nothing for it. It loads fiddle when the harness loads, because loading it later under Bundler resets Bundler between iterations.

Generated with Claude Code

@k0kubun

k0kubun commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Can we define Windows-only modules (and ideally methods as well) only when it's Windows? Unlike what's executed inside run_benchmarks.rb, what runs in harness/harness-common.rb directly impacts the benchmark target's performance, such as the size of allocated memory.

Combined with #549 (which may not need to be done inside harness-common.rb in the first place), I see a couple of modules and several methods that don't need to be defined in non-Windows platforms. Maybe we can define all of them under an is_windows guard.

@hsbt
hsbt force-pushed the claude/frosty-einstein-9209d8 branch from acd67d9 to feec42e Compare October 15, 2026 21:38
@hsbt
hsbt force-pushed the claude/frosty-einstein-9209d8 branch from feec42e to 3bd4752 Compare October 29, 2026 02:59
hsbt and others added 2 commits October 29, 2026 12:24
Windows has neither /proc nor ps nor getrusage, so RSS and MAXRSS were always 0. The working set and its peak from GetProcessMemoryInfo are the closest equivalents, read in a file that only Windows requires. Fiddle is loaded with the harness, because loading it after Bundler.setup resets Bundler between iterations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changes in private memory on Windows show up in the commit charge (PagefileUsage of GetProcessMemoryInfo) more than in the working set. The result JSON keeps it and its peak as commit_charge and peak_commit_charge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsbt
hsbt force-pushed the claude/frosty-einstein-9209d8 branch from 3bd4752 to a4c594d Compare October 29, 2026 03:25
@hsbt

hsbt commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

👌 I moved the memory counter code into a separate module and load it only on Windows.

@hsbt
hsbt merged commit 73918b2 into main Oct 29, 2026
15 checks passed
@hsbt
hsbt deleted the claude/frosty-einstein-9209d8 branch October 29, 2026 05:07
@k0kubun

k0kubun commented Oct 29, 2026

Copy link
Copy Markdown
Member

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants