Repository navigation
feat(inspector): support JSC heap allocation sampling - #107
Merged
Merged
Conversation
Expose real per-VM allocation-site sampling through callback and promise Sessions, preserving Node validation and sampling lifecycle. Validate numeric inputs through immutable operations before entering the native sampler.
steipete
force-pushed
the
claude/w144-allocation-sampling
branch
from
October 5, 2026 09:43
d413a5e to
46754a4
Compare
steipete
marked this pull request as ready for review
October 5, 2026 09:43
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.
OpenClaw's catalog performance consumers reach
HeapProfiler.startSampling, which the in-process inspector did not implement. AddstartSampling,getSamplingProfile, andstopSamplingfor callback and promise Sessions using the real per-VM JSC allocation sampler from the immutable OpenClaw WebKit release integrated by #124.Preserve Node defaults, synchronous callbacks, repeated-start behavior, major/minor collection flags, worker isolation, and session cleanup. Profile retrieval forces full collection. Numeric validation uses an immutable intrinsic and truncation happens in the native binding, so replacing public numeric helpers cannot violate the engine's interval precondition. Sampling through a worker's
connectToMainThread()remains unsupported. Upstream's CLI heap-profile work in oven-sh#34842 is separate from these Session commands.Validation on Linux x64, with unmodified OpenClaw
b02eab15853b6471d1869f2a2cb0f135b7aefe4dand Node 24.21.0 controls:startSampling.The committed production manifest is unchanged by this PR and selects the published engine. No runtime publication is included.
Final head
c8de1bfd252a50c03286cb83d7e3a73cca6b5395passes both native CI lanes, formatting, source lints, and built-in module typechecking. The complete standalone Linux proof used46754a481e350a63b64ac3edd5449ef1056604ba; the final follow-up adds only the missing TypeScript declaration for the intrinsic, with unchanged runtime code. The final head also builds successfully on macOS arm64.