Skip to content

Alloc profile - #1873

Merged
Bike merged 8 commits into
mainfrom
alloc-profile
Sep 29, 2026
Merged

Bike merged 8 commits into
mainfrom
alloc-profile

Conversation

@drmeister

Copy link
Copy Markdown
Collaborator

A bunch of changes to improve memory profiling and memory measurement.
Also a fix or two.

drmeister and others added 8 commits September 27, 2026 23:37
Reserve eight bytes per double-float element instead of four in the native compiler allocation path, preventing underallocation and writes beyond the allocated vector storage.
Pass unrounded segment lengths to LLVM, which already rounds address ranges to pages. Avoid changing permissions on an unrelated neighboring page when a segment starts at an unaligned address.
Compile out arena installation, trampoline generation and snapshot diagnostic messages together with their logging-only counters. Preserve allocation, fallback and snapshot behavior.
Expand ROOM with consistent GC statistics, current and peak RSS, retained object-file buffers, trampoline storage and measured GDB JIT payloads. Distinguish unavailable measurements and overlapping capacities from resident memory.

Add -P/--no-gdb-jit and -H/--hpc, initialize their shared option from CLASP_NO_GDB_JIT, and use it across module and trampoline registration. Synchronize native accounting and tolerate object files awaiting materialization.
Register executable segments using their actual working-memory base. Merge adjacent or overlapping dynamic ranges with signal-safe atomic readers, increase capacity to 16K entries, and report usage and rejected registrations.

Record CPU and allocation stack-walk termination evidence, expose summaries and optional detailed reports, and add Lisp-callable range and synthetic-frame regression tests.

Annotate flamegraphs with range statistics, allocation totals and RSS, support multiline headers and with-cpu-profile, suppress lone nonadvancing-frame summaries, and reliably reset buffers after report generation.
this code is all slightly dodgy to begin with because LLVM only
wants protectMappedMemory called on results from allocateMappedMemory
which we're not using. It's just doing mprotect underneath so it's
probably okay, but still.

drmeister was hitting segfaults with the aligned up sizes, because
the mprotect spilled into subsequent pages.
@Bike
Bike merged commit 75f77bb into main Sep 29, 2026
6 checks passed
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