Skip to content

fix(ddprof_live_heap): widen inuse-space/inuse-objects margin to 10% - #207

Open
r1viollet wants to merge 1 commit into
mainfrom
r1viollet/ddprof-live-heap-accuracy-margin
Open

fix(ddprof_live_heap): widen inuse-space/inuse-objects margin to 10%#207
r1viollet wants to merge 1 commit into
mainfrom
r1viollet/ddprof-live-heap-accuracy-margin

Conversation

@r1viollet

@r1viollet r1viollet commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

CI inuse-space shows 91% (with 8% gap).

Actual breakdown from CI profile data:

  • leak_function(int): 536,370 bytes (91%)
  • _IO_printf...file_doallocate (stdio): 48,760 bytes (8%)
  • allocate_memory (operator new): 0 bytes

The 8% gap is from stdio buffer allocation that persists in memory during the test.

Root cause: The startup printf creates a persistent stdio buffer. This is not
a ddprof accuracy issue but rather a test artifact.

Better fix available in PR #209: Remove the diagnostic printf from main.cc
instead of widening margins. This directly addresses the root cause and keeps
the 5% margin expectations intact. PR #209 is preferred over this approach.

CI consistently reports ~91% for leak_function in inuse-space and inuse-objects
due to C++ runtime overhead and other unaccounted allocations. Widen margin from
5% to 10% to match empirical behavior while maintaining test validity.
@r1viollet r1viollet closed this Sep 8, 2026
@r1viollet r1viollet reopened this Sep 8, 2026
@r1viollet
r1viollet marked this pull request as ready for review September 8, 2026 07:55
@r1viollet
r1viollet requested a review from a team as a code owner September 8, 2026 07:55
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.

1 participant