Skip to content

workflow: add the HEAP_PROFILE_TRACE well-known command - #260

Merged
mattklein123 merged 4 commits into
mainfrom
miguel/heap-profile-trace-command
Nov 19, 2026
Merged

mattklein123 merged 4 commits into
mainfrom
miguel/heap-profile-trace-command

Conversation

@murki

@murki murki commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

First PR of the stack that ships a heap profile as a built-in SDK command, the same way stack_sampling_trace shipped (api → shared-core → monorepo / capture-sdk).

Adds WellKnownCommandType.HEAP_PROFILE_TRACE = 4, key heap_profile_trace: a Perfetto heap profile of the app process through Android's ProfilingManager. Android 15+ only, config version 51.

Argument Type Default
duration_ms INT64 5000
buffer_size_kb INT64 8192
sampling_interval_bytes INT64 65536
track_java_allocations BOOL true

The SDK passes each value to the platform, which clamps it to its own bounds.

Why these defaults:

  • 64 KiB interval. heapprofd's shared memory is fixed at 8 MiB and ProfilingManager doesn't block the client. When the buffer overruns, the client disconnects and the truncated trace is still reported as a success. In our runs on an API 36 emulator and a Pixel 10, 16 KiB overran within 2 s; 64 KiB, the platform maximum, ran the full 5 s.
  • Java allocations by default. A profile records one heap or the other, never both, so track_java_allocations = false switches to the native heap.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
murki and others added 3 commits November 5, 2026 13:27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattklein123
mattklein123 marked this pull request as ready for review November 19, 2026 17:15
@mattklein123
mattklein123 merged commit f1eeb86 into main Nov 19, 2026
2 checks passed
@mattklein123
mattklein123 deleted the miguel/heap-profile-trace-command branch November 19, 2026 17:29
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants