A memory profiler for Linux.
Major changes:
_rjem_aligned_alloc
(jemalloc variant of aligned_malloc
)LD_PRELOAD
-hooked functions by itself so none actually get calledMajor changes:
MEMORY_PROFILER_TRACK_CHILD_PROCESSES
environment variable (disabled by default)mmap
/munmap
calls are now gathered by default (you can disable this with MEMORY_PROFILER_GATHER_MAPS
)/proc/self/smaps
PR_SET_VMA_ANON_NAME
(Linux 5.17 or newer; on older kernels this is emulated in user space)__mmap
and __munmap
are now hooked intoAllocationList::only_alive_at
AllocationList::only_from_maps
Graph::start_at
Graph::end_at
Graph::show_address_space
Graph::show_rss
MapList
Map
AllocationList::only_not_deallocated_after_at_least
AllocationList::only_not_deallocated_until_at_most
Graph::truncate_until
Graph::extend_until
only_not_deallocated_in_current_range
, only_deallocated_in_current_range
aligned_alloc
memalign
Major changes:
MEMORY_PROFILER_GRAB_BACKTRACES_ON_FREE
environment variable to turn this offAllocationList::only_matching_deallocation_backtraces
AllocationList::only_not_matching_deallocation_backtraces
AllocationList::only_position_in_chain_at_least
AllocationList::only_position_in_chain_at_most
AllocationList::only_chain_leaked
server
subcommand of the CLI should now use less memory when loading large data filesmalloc_usable_size
when called with a NULL
argument now matches glibcMajor changes:
MEMORY_PROFILER_BACKTRACE_CACHE_SIZE
environment variable knob was replaced with MEMORY_PROFILER_BACKTRACE_CACHE_SIZE_LEVEL_1
and MEMORY_PROFILER_BACKTRACE_CACHE_SIZE_LEVEL_2
to control the size of the per-thread caches and the global cache respectivelyMEMORY_PROFILER_PRECISE_TIMESTAMPS
environment variable knob was removed (always gathering precise timestamps is fast enough on amd64)MEMORY_PROFILER_TEMPORARY_ALLOCATION_PENDING_THRESHOLD
is now unset, which means that the allocations will be buffered indefinitely until they're either culled or until they'll live long enough to not be eligible for culling (might increase memory usage in certain cases)Graph::show_memory_usage
Graph::show_live_allocations
Graph::show_new_allocations
Graph::show_deallocations
AllocationList::only_group_max_total_usage_first_seen_at_least
AllocationList::only_jemalloc
extract
(will unpack all of the files embedded into a given data file)strip
subcommand will now not buffer allocations indefinitely when using the --threshold
option, which results in a significantly lower memory usage when stripping huge data files from long profiling runsmalloc_usable_size
now works properly when compiled with the jemalloc
featurereallocarray
doesn't segfault anymoreMajor changes:
memory-profiler
to bytehound
jemallocator
crate only)script
subcommandsqueeze
subcommand was renamed to strip
strip
subcommand to strip away only a subset of temporary allocationsmmap
calls are now always gathered in order (if you have enabled their gathering)This is a bugfix release that fixes a possible deadlock when FDEs are dynamically registered at runtime.
Major changes:
MEMORY_PROFILER_CULL_TEMPORARY_ALLOCATIONS
set to 1
.reallocarray
.__register_frame
.mmap
calls are now not gathered by default.Major changes:
perf_event_open
is unavailable (e.g. unpatched MIPS64 systems, docker containers, etc.) are now supported.longjmp
/setjmp
are now partially supported when using shadow stack based unwinding.dlopen
are now properly handled.backtrace
on certain architectures while using shadow stack based unwinding would crash the program.jemalloc
feature to use jemalloc instead of the system allocator.memory_profiler_start
and memory_profiler_stop
functions exported by libmemory_profiler.so
. Those are equivalent to controlling the profiler through signals.Major changes:
MEMORY_PROFILER_DISABLE_BY_DEFAULT
the profiler will not initialize itself nor create an output file.MEMORY_PROFILER_REGISTER_SIGUSR1
and MEMORY_PROFILER_REGISTER_SIGUSR2
.MEMORY_PROFILER_ENABLE_SERVER
environment variable.MEMORY_PROILER_BASE_SERVER_PORT
environment variable.MEMORY_PROFILER_OUTPUT
now supports an %n
placeholder.Major changes:
libstdc++
when a C++ exception is thrown.