FS#79696 - [jemalloc] please use configure --enable-prof

Attached to Project: Arch Linux
Opened by Petr Špaček (pspacek) - Friday, 15 September 2023, 08:03 GMT
Last edited by Christian Hesse (eworm) - Monday, 18 September 2023, 13:47 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Christian Hesse (eworm)
Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
It would be helpful if jemalloc was built using `./configure --enable-prof`.

It enables memory profiling described here: https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Heap-Profiling . This feature is instrumental in debugging memory-consumption-related issues.

Additional info:
* Debian has it enabled on i386 and x86_64, see http://deb.debian.org/debian/pool/main/j/jemalloc/jemalloc_5.3.0-1.debian.tar.xz

Steps to reproduce:
* Tested on jemalloc 1:5.3.0-2
* Attempt to run a profiling session:
MALLOC_CONF="abort_conf:true,prof:true" LD_PRELOAD=/usr/lib/libjemalloc.so date
<jemalloc>: Invalid conf pair: prof:true
<jemalloc>: Abort (abort_conf:true) on invalid conf value (see above).
Aborted (core dumped)

Thank you for considering this request.
This task depends upon

Closed by  Christian Hesse (eworm)
Monday, 18 September 2023, 13:47 GMT
Reason for closing:  Implemented
Additional comments about closing:  jemalloc 1:5.3.0-3
Comment by Christian Hesse (eworm) - Monday, 18 September 2023, 12:56 GMT
Does that introduce performance penalties? Also several backtracing approaches are supported, namely `libunwind`, `libgcc` and `gcc intrinsics`. Do we want a specific one?
Comment by Petr Špaček (pspacek) - Monday, 18 September 2023, 13:20 GMT
So far I did not have any trouble with defaults, i.e. prof-libgcc. Debian is using the default unwinder as well.

As for performance impact, profiling _also_ needs to be runtime-enabled to do anything (via MALLOC_CONF env variable or jemalloc API), presumably it should NOT be high impact - but that's my speculation.

Upstream does not mention any performance impact in their docs:
https://jemalloc.net/jemalloc.3.html
https://github.com/jemalloc/jemalloc/blob/dev/TUNING.md
Comment by Petr Špaček (pspacek) - Monday, 18 September 2023, 13:21 GMT
Comment by Christian Hesse (eworm) - Monday, 18 September 2023, 13:47 GMT
So let's give it a try...

Loading...