Write symbolized jemalloc profiles (eliminating the need for a binary during heap profile generation)#93099
Merged
azat merged 3 commits intoClickHouse:masterfrom Jan 1, 2026
Merged
Conversation
Contributor
|
Workflow [PR], commit [6d5ce15] Summary: ❌
|
c218b92 to
b655a61
Compare
yariks5s
approved these changes
Dec 31, 2025
We already have "official documentation"
It was inconvenience for a long time that you need the binary for jemalloc heap profiler (different architecture, different versions and so on) This patch will write second file with a `.symbolized` prefix, for which you do not need binary anymore for `jeprof`, and you can simply run, i.e. `jeprof --text heap.0.symbolized` Internally `jeprof` supports symbolized profiles, you just need to provide a map from addresses to symbols (with some quirks) and `jeprof` will read it out of the box. Note, I've though about adding special hooks for jemalloc, but it is tricky, since you cannot everything inside generating this profile, so this implementation simply reads the file written my jemalloc, and creates a new profile with a `.symbolized` prefix.
7b783e7 to
6d5ce15
Compare
Merged
via the queue into
ClickHouse:master
with commit Jan 1, 2026
3fad310
129 of 131 checks passed
This was referenced Jan 19, 2026
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Write symbolized jemalloc profiles (eliminating the need for a binary during heap profile generation)
It was inconvenience for a long time that you need the binary for jemalloc heap profiler (different architecture, different versions and so on)
This patch will write second file with a
.symbolizedprefix, for which you do not need binary anymore forjeprof, and you can simply run, i.e.jeprof --text heap.0.symbolizedInternally
jeprofsupports symbolized profiles, you just need to provide a map from addresses to symbols (with some quirks) andjeprofwill read it out of the box.Note, I've though about adding special hooks for jemalloc, but it is tricky, since you cannot everything inside generating this profile, so this implementation simply reads the file written my jemalloc, and creates a new profile with a
.symbolizedprefix.Also note that query execution time for
SYSTEM JEMALLOC FLUSH PROFILEincreased to 10 seconds (egh, handling inlines is slow, in comparison plainjeprofworks way slower, butjeprof --tools addr2line:/usr/bin/llvm-addr2line,nm:/usr/bin/llvm-nm,objdump:/usr/bin/objdump,c++filt:/usr/bin/llvm-cxxfilttakes ~90 seconds). And since it takes time, it is done only forSYSTEM JEMALLOC FLUSH PROFILE, and not forjemalloc_flush_profile_interval_bytes/jemalloc_flush_profile_on_memory_exceededP.S. I've compared the flamegraphs w/ symbolized profiles and w/o, and I did not noticed any difference except for differences in inline demangling, but this should be minor