feat(android): Parse memory and GC info from ANR thread dumps#5428
Open
markushi wants to merge 5 commits into
Open
feat(android): Parse memory and GC info from ANR thread dumps#5428markushi wants to merge 5 commits into
markushi wants to merge 5 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8558cac | 306.16 ms | 355.24 ms | 49.09 ms |
| 8687935 | 332.52 ms | 362.23 ms | 29.71 ms |
| 9054d65 | 330.94 ms | 403.24 ms | 72.30 ms |
| fc5ccaf | 322.49 ms | 405.25 ms | 82.76 ms |
| 8c1fb22 | 316.62 ms | 352.78 ms | 36.16 ms |
| d8912da | 329.94 ms | 389.68 ms | 59.74 ms |
| d15471f | 315.61 ms | 360.22 ms | 44.61 ms |
| b6702b0 | 395.86 ms | 409.98 ms | 14.12 ms |
| 62b579c | 318.48 ms | 367.71 ms | 49.24 ms |
| ed33deb | 312.34 ms | 369.71 ms | 57.37 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8558cac | 0 B | 0 B | 0 B |
| 8687935 | 1.58 MiB | 2.19 MiB | 619.17 KiB |
| 9054d65 | 1.58 MiB | 2.29 MiB | 723.38 KiB |
| fc5ccaf | 1.58 MiB | 2.13 MiB | 557.54 KiB |
| 8c1fb22 | 0 B | 0 B | 0 B |
| d8912da | 0 B | 0 B | 0 B |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| b6702b0 | 1.58 MiB | 2.12 MiB | 551.79 KiB |
| 62b579c | 0 B | 0 B | 0 B |
| ed33deb | 1.58 MiB | 2.13 MiB | 559.52 KiB |
Member
Author
|
@sentry review |
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.
📜 Description
Parses memory and GC metrics from ANRv2 thread dumps (ApplicationExitInfo traces) and enriches the Device context on ANR events.
New classes:
ThreadDumpMemoryInfo— data holder for parsed memory/GC fields (bytes and milliseconds)ThreadDumpMemoryInfoParser— parses lines likeFree memory 3107KB,Total GC time: 11.807msusing simple suffix-based parsing (counterpart to Android'sPrettySizeoutput)The parsed memory info flows through
ThreadDumpParser→ParseResult→AnrV2Hint→ApplicationExitInfoEventProcessor, which sets:device.freeMemory←freeMemoryUntilOOMEBytesdevice.usableMemory←freeMemoryBytesdevice.memorySize←maxMemoryBytesResolves: #2801
💡 Motivation and Context
ANR thread dumps from ART contain memory and GC statistics that are currently ignored. This information is valuable for diagnosing memory pressure-related ANRs.
💚 How did you test it?
ThreadDumpMemoryInfoParser(all size units, invalid input, time parsing, all fields, unrelated lines)ThreadDumpParserTestusing real thread dump fixtures📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
"memory"context)