Skip to content

fix: bound profiler memory growth by trimming interned call stacks - #5503

Merged
jamescrosswell merged 20 commits into
mainfrom
fix/5469-trim-live-session-state
Aug 31, 2026
Merged

jamescrosswell merged 20 commits into
mainfrom
fix/5469-trim-live-session-state

Make the call stack budget per-factory rather than a static

908f26f
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Aug 31, 2026

1 issue

find-bugs: Found 1 issue (1 high)

High

AddSample keeps processing after trim instead of skipping the invalidated sample - `src/Sentry.Profiling/SampleProfileBuilder.cs:57-61`

When trim generation changes, clear _stackIndexes and return immediately; the current event's CallStackIndex was invalidated by TrimLiveSessionState, and continuing can cache a bad stack under a recycled index.


⏱ 31m 33s · 2.6M in / 244.5k out · $3.83

Annotations

Check failure on line 61 in src/Sentry.Profiling/SampleProfileBuilder.cs

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

AddSample keeps processing after trim instead of skipping the invalidated sample

When trim generation changes, clear `_stackIndexes` and return immediately; the current event's CallStackIndex was invalidated by TrimLiveSessionState, and continuing can cache a bad stack under a recycled index.