Repository navigation
procwatch: live heap by allocation site, for measuring builds (alloc-sites) - #744
Merged
Merged
Conversation
…sites) Where a native app's memory goes, by who asked for it. Counting samples one in every 32 KiB a thread asks for (a block of 32 KiB or more always), keeps the sampled block's call stack until it is freed, and with PROCWATCH_ALLOC_SITES=<folder> writes the live sites, the counted live and peak heap, every NT heap's regions and busy bytes, and the loaded modules to a file each time the event Local\procwatch-alloc-sites-<pid> is set (Windows). rune's alloc-sites feature adds the GPU device's allocations by label. Tables are made on the first sample with VirtualAlloc, nothing is sampled inside the allocator, and the dump runs on a raw thread that waits on its event. Ordinary builds compile none of it.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
…une and procwatch (#2370) A feature-set warning sweep across Linux, macOS, Windows, and wasm32 found eight dead-code warnings under optional and non-default feature sets: - `crates/rune/src/open_path.rs:203` (`file_uri_from_bytes`, added in #1947): used on Unix only under `feature = "dbus"` (FileManager1) and tests; gate with `feature = "dbus"` alongside `test`. - `crates/rune/src/platform/preferences.rs:77` (`DEFAULT_DOUBLE_CLICK_SECS`, added in #1923/#2128): used on Linux only under `feature = "dbus"` and tests; gate with `all(target_os = "linux", feature = "dbus")` alongside `test`. - `crates/rune/src/window/titlebar/linux.rs:82` (`Sides::ALL`, added in #2244): used only in `linux_tests.rs`; gate with `#[cfg(test)]`. - `crates/rune/src/frame/live_log.rs:33` (`CAPTURED` / `capture_frames`, added in #2309): used only in `window/win32/resize_sync/tests.rs` under `frame-profile`; gate with `#[cfg(all(test, target_os = "windows"))]`. - `crates/procwatch/src/alloc/sites.rs:222,271,413,418` (`report`, `unsampled`, `os::modules`, `os::nt_heaps`, added in #744): `alloc-sites` sampling and dumper are Windows-only; gate the implementation behind `#[cfg(windows)]` with clean `#[cfg(not(windows))]` no-op stubs.
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.
Where a native app's memory goes, by who asked for it, in a measuring build:
procwatch/alloc-sites(andrune/alloc-sitesfor the GPU device's allocations by label).Countingsamples one in every 32 KiB a thread asks for (a block of 32 KiB or more always) and keeps the sampled block's call stack until it's freed.PROCWATCH_ALLOC_SITES=<folder>, setting the eventLocal\procwatch-alloc-sites-<pid>writes the live sites, the counted live and peak heap, every NT heap's regions and busy bytes, the loaded modules and the GPU allocations to a file (Windows).First use: OpenCode (Rune)'s Home holds about 43 MB of live Rust and Luau heap against 221 MB of private bytes; the dumps found the 4 MiB-per-VM Luau code blocks (#743) and mimalloc pages committed whole and never touched.