JEPROF(1)
β¨ JEPROF(1) β¨
okay so bestie, welcome to jeprof β the User Manual edition, no cap. she analyzes and prints jemalloc's heap profile dumps and she is literally iconic π
π NAME π
jeprof β analyze and print jemalloc's heap profile dumps. that's it, that's the vibe. π«Ά
πΈ SYNOPSIS πΈ
jeprof [options] <program> <profiles>
jeprof [options] <symbolized-profiles>
jeprof [options] <profile>
jeprof --symbols program
four whole entry points, she contains multitudes π
π¦ DESCRIPTION π¦
okay so jeprof can parse, analyze, and generate user-readable output from jemalloc's memory profile dumps. if you wanna know about jemalloc and the opt.prof option, go read jemalloc(3) or hit up the jemalloc website at http://jemalloc.net/ β iykyk.
ngl, jeprof is based on pprof(1), which is developed as part of the gperftools package at https://github.com/gperftools/gperftools. so if she seems familiar, that's why, she's giving gperftools energy π
common usage (the ones you'll actually be living in) π
jeprof [options] <program> <profiles>β interactive mode, bestie.<profiles>is a space separated list of profile names. that's it, that's the whole thing.jeprof [options] <symbolized-profiles>β<symbolized-profiles>is a list of profile files where each file contains the necessary symbol mappings as well as profile data (likely generated with--raw). two for one, we love to see it.jeprof [options] <profile>β<profile>is a remote form. and each name can be:/path/to/profileβ a path to a profile file. simple. clean. β¨host:port[/<service]>β a location of a service to get the profile from. remote fetch era π
<service> can be one of these little guys: /pprof/heap, /pprof/profile, /pprof/pmuprofile, /pprof/growth, /pprof/contention, /pprof/wall, /pprof/censusprofile, or /pprof/filteredprofile.
for instance:
jeprof http://myserver.example.com:80/pprof/heap
and heads up: if you omit /<service>, the service defaults to /pprof/profile (CPU profiling). so it just decides for you. periodt.
jeprof --symbols programβ maps addresses to symbol names. in this mode, stdin should be a list of library mappings, in the same format as is found in the heap- and CPU-profile files (this loosely matches that of/proc/self/mapson Linux), followed by a list of hex addresses to map, one per line. yes, both things, in that order, from stdin. she's particular and honestly? respect. π
π OPTIONS AND ARGUMENTS π
Options
--cumβ sort by cumulative data. king behavior honestly.--base=baseβ subtract base from profile before display. math is happening.--interactiveβ run in interactive mode. (interactivehelpgives help) [default] β this is the default one btw, so if you don't pick anything you get the hangout mode π«Ά--seconds=nβ length of time for dynamic profiles. [default=30 secs]--add_lib=fileβ read additional symbols and line info from the given library.--lib_prefix=dirβ comma separated list of library path prefixes.
Reporting granularity
how zoomed-in do you want it, bestie π
--addressesβ report at address level. maximum zoom.--linesβ report at source line level.--functionsβ report at function level. [default]--filesβ report at source file level.
Output type
pick your format, she does all of them, she's flexible like that π
--textβ generate text report.--callgrindβ generate callgrind format to stdout.--gvβ generate Postscript and display.--evinceβ generate PDF and display.--webβ generate SVG and display.--list=regexpβ generate source listing of matching routines.--disasm=regexpβ generate disassembly of matching routines.--symbolsβ print demangled symbol names found at given addresses.--dotβ generate DOT file to stdout.--psβ generate PostScript to stdout.--pdfβ generate PDF to stdout.--svgβ generate SVG to stdout.--gifβ generate GIF to stdout.--rawβ generate symbolized jeprof data (useful with remote fetch). yes bestie, remote fetch, we love a combo move.
Heap-profile options
--inuse_spaceβ display in-use (mega)bytes. [default]--inuse_objectsβ display in-use objects.--alloc_spaceβ display allocated (mega)bytes.--alloc_objectsβ display allocated objects.--show_bytesβ display space in bytes. the tiny unit, for the precise girlies.--drop_negativeβ ignore negative differences. not today, negativity π
Contention-profile options
--total_delayβ display total delay at each region. [default]--contentionsβ display number of delays at each region.--mean_delayβ display mean delay at each region.
Call-graph options
--nodecount=nβ show at most so many nodes. [default=80]--nodefraction=fβ hide nodes belowf*total. [default=.005]--edgefraction=fβ hide edges belowf*total. [default=.001]--maxdegree=nβ max incoming/outgoing edges per node. [default=8]--focus=regexpβ focus on backtraces with nodes matching regexp.--thread=nβ show profile for thread n.--ignore=regexpβ ignore backtraces with nodes matching regexp.--scale=nβ set GV scaling. [default=0]--heapcheckβ make nodes with non-0 object counts (i.e. direct leak generators) more visible. giving those nodes main character energy fr fr π--retain=regexpβ retain only nodes that match regexp.--exclude=regexpβ exclude all nodes that match regexp.
Miscellaneous
--tools=prefixor--tools=binary:fullpath[,...]β path for object tool pathnames. two ways to say it, both valid π--testβ run unit tests.--helpβ this message.--versionβ version information.
π ENVIRONMENT π
the following environment variables affect the execution of jeprof, so set them if you want, they're listening:
JEPROF_TMPDIRβ profiles directory. defaults to$HOME/jeprof. that's where your stuff lives πJEPROF_TOOLSβ prefix for object tools pathnames.
β EXAMPLES β
okay here's where it gets fun, let me show you the moves:
jeprof /bin/ls ls.prof
enters interactive mode. cozy hangout time π
jeprof --text /bin/ls ls.prof
generates one line per procedure.
jeprof --web /bin/ls ls.prof
displays annotated call-graph in web browser. fancy β¨
jeprof --gv /bin/ls ls.prof
generates annotated call-graph and displays via gv.
jeprof --gv --focus=Mutex /bin/ls ls.prof
restrict to code paths that involve an entry that matches Mutex.
jeprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof
restrict to code paths that involve an entry that matches Mutex and does not match string. both filters, at once, she can multitask π
jeprof --list=getdir /bin/ls ls.prof
generates disassembly listing of all routines with at least one sample that match getdir(). the listing is annotated with the flat and cumulative sample counts at each line.
jeprof --disasm=getdir /bin/ls ls.prof
generates disassembly listing of all routines with at least one sample that match getdir(). the listing is annotated with the flat and cumulative sample counts at each PC value.
jeprof http://localhost:1234/
enters interactive mode.
jeprof --text localhost:1234
outputs one line per procedure for localhost:1234.
jeprof --raw localhost:1234 > ./local.raw; jeprof --text ./local.raw
fetches a remote profile for later analysis and then analyzes it in text mode. grab now, analyze later, that's the strategy π
π SEE ALSO π
like obviously, the whole family, go say hi.
okay bestie that's the whole page, you ate it π β¨ this was jemalloc 5.1.0_0, dated 2019-01-12, and it's been a pleasure fr fr π«Άπ no cap, go profile something.
π¦ where this page comes from
- debian bookworm: libjemalloc-dev 5.3.0-1 Β· BSD-2-Clause
- debian trixie: libjemalloc-dev 5.3.0-3 Β· BSD-2-Clause
- ubuntu jammy: libjemalloc-dev 5.2.1-4ubuntu1 Β· BSD-2-Clause
- ubuntu noble: libjemalloc-dev 5.3.0-2build1 Β· BSD-2-Clause
- ubuntu questing: libjemalloc-dev 5.3.0-3build1
- ubuntu resolute: libjemalloc-dev 5.3.0-4 Β· BSD-2-Clause
- ubuntu stonking: libjemalloc-dev 5.3.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms