Tool for profiling heap usage and memory management

Overview

vizzy build status

> ./build/vizzytrace /tmp/heapinfo.trace /bin/find /home/zznop -name vizzy

 _  _  ____  ____  ____  _  _
( \/ )(_  _)(_   )(_   )( \/ )
 \  /  _)(_  / /_  / /_  \  /
  \/  (____)(____)(____) (__)

[*] Dropping libvizzy to disk at /tmp/libvizzy.so
[*] Child process started (pid=13849)
/home/zznop/projects/vizzy
[*] Child process exited with a return code of 0
> python3 ./script/vizzyreport.py /tmp/heapinfo.trace 
HEAP SUMMARY:
    in use at exit   : 11060 bytes in 58 blocks
    total heap usage : 422216 allocs, 422157 frees, 792452324 bytes allocated

Description

Vizzy is a suite of dynamic analysis tools for profiling heap usage and memory management. Vizzy consists of a tracer application (vizzytrace) that injects (LD_PRELOAD's) a shared object into a process to hook libc allocation and free APIs. These hooks log timestamped information on each allocation and free to a trace file for post-processing. Vizzy contains a script (vizzyreport.py) that processes vizzy trace files to generate reports and visualizations.

Usage

vizzytrace

vizzytrace <log> <command>

Required:
  log        Path to output trace log
  command    Command to execute (specify the full path to the executable)

Example:
  vizzy /tmp/heaptrace.csv /bin/find . -name vizzy

To run a process under vizzytrace first supply the path to where the trace log should be written to, then supply the command line starting with the full path to the tracee executable. vizzytrace will take the following steps:

  1. Patch libvizzy's config section with the file path for where it should write the trace file
  2. Drop libvizzy to /tmp
  3. Spawn the tracee executable as a child process and preload the libvizzy shared object
  4. Wait on the child process to exit

vizzyreport.py

usage: vizzyreport.py [-h] [--heap-layout-time HEAP_LAYOUT_TIME] [--mem-usage]
                      tracefile

positional arguments:
  tracefile             File path to vizzy heap trace file

optional arguments:
  -h, --help            show this help message and exit
  --heap-layout-time HEAP_LAYOUT_TIME
                        Visualize heap layout at specified time
  --mem-usage           Visualize heap memory usage over time

Example Visualization:

Alt text

Build

To build vizzytrace and libvizzy install SCons from the package manager and run:

scons

vizzyreport.py requires the Python 3 Bokeh package. This can be installed using pip.

pip install bokeh
Owner
Brandon Miller
Brandon Miller
Artifacts of that Memory Management Tsoding Session

Artifacts of those Memory Management Tsoding Sessions Quick Start $ make $ ./heap Limitations The pointers to the heap can only be located in the heap

Tsoding 51 May 15, 2022
Memory-dumper - A tool for dumping files from processes memory

What is memory-dumper memory-dumper is a tool for dumping files from process's memory. The main purpose is to find patterns inside the process's memor

Alexander Nestorov 29 Feb 5, 2022
The Hoard Memory Allocator: A Fast, Scalable, and Memory-efficient Malloc for Linux, Windows, and Mac.

The Hoard Memory Allocator Copyright (C) 1998-2020 by Emery Berger The Hoard memory allocator is a fast, scalable, and memory-efficient memory allocat

Emery Berger 882 May 13, 2022
Custom memory allocators in C++ to improve the performance of dynamic memory allocation

Table of Contents Introduction Build instructions What's wrong with Malloc? Custom allocators Linear Allocator Stack Allocator Pool Allocator Free lis

Mariano Trebino 1.2k May 9, 2022
Mesh - A memory allocator that automatically reduces the memory footprint of C/C++ applications.

Mesh: Compacting Memory Management for C/C++ Mesh is a drop in replacement for malloc(3) that can transparently recover from memory fragmentation with

PLASMA @ UMass 1.4k May 7, 2022
Memory instrumentation tool for android app&game developers.

Overview LoliProfiler is a C/C++ memory profiling tool for Android games and applications. LoliProfiler supports profiling debuggable applications out

Tencent 416 May 13, 2022
A tool for tracking memory allocation based ld-preload

libmallocTrace A tool for tracking memory allocation based ld-preload how to build make cd example && make how to use a simple way is to execute some

赵政 1 Mar 12, 2022
MemoryLeakDetector is a native memory leak monitoring tool developed by Xigua video android team

MemoryLeakDetector is a native memory leak monitoring tool developed by Xigua video android team. It has simple access, wide monitoring range, excellent performance and good stability. It is widely used in native-memory-leak-governance of ByteDance's major apps, and the benefits are significant!

Bytedance Inc. 697 May 13, 2022
STL compatible C++ memory allocator library using a new RawAllocator concept that is similar to an Allocator but easier to use and write.

memory The C++ STL allocator model has various flaws. For example, they are fixed to a certain type, because they are almost necessarily required to b

Jonathan Müller 1.1k May 9, 2022
OpenXenium JTAG and Flash Memory programmer

OpenXenium JTAG and Flash Memory programmer * Read: "Home Brew" on ORIGINAL XBOX - a detailed article on why and how * The tools in this repo will all

Koos du Preez 25 Feb 14, 2022
A simple windows driver that can read and write to process memory from kernel mode

ReadWriteProcessMemoryDriver A simple windows driver that can read and write to process memory from kernel mode This was just a small project for me t

Hypervisor 6 Mar 30, 2022
STL compatible C++ memory allocator library using a new RawAllocator concept that is similar to an Allocator but easier to use and write.

STL compatible C++ memory allocator library using a new RawAllocator concept that is similar to an Allocator but easier to use and write.

Jonathan Müller 1k Dec 2, 2021
Test cpu and memory speed at linux-vps

Тест скорости процессора и памяти на linux-vps. Занимается бессмысленным перемножением массивов случайных чисел, для определения скорости процессора и

Anton 3 Nov 30, 2021
Using shared memory to communicate between two executables or processes, for Windows, Linux and MacOS (posix). Can also be useful for remote visualization/debugging.

shared-memory-example Using shared memory to communicate between two executables or processes, for Windows, Linux and MacOS (posix). Can also be usefu

null 8 Mar 18, 2022
A simple C++ library for creating and managing bitstreams in memory.

ezbitstream (v0.001) A simple C++ library for creating and managing bitstreams in memory. API & Implementation ezbitstream implements bitstreams with

Unsal Ozturk 2 Feb 4, 2022
Detect strange memory regions and DLLs

MalMemDetect Detect strange memory regions and DLLs Compile as a DLL and inject into a process to identify hollowed DLLs and unmapped memory region ca

null 119 May 5, 2022
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C

rpmalloc - General Purpose Memory Allocator This library provides a public domain cross platform lock free thread caching 16-byte aligned memory alloc

Mattias Jansson 1.5k May 10, 2022
manually map driver for a signed driver memory space

smap manually map driver for a signed driver memory space credits https://github.com/btbd/umap tested system Windows 10 Education 20H2 UEFI installati

ekknod 71 Apr 9, 2022
A single file drop-in memory leak tracking solution for C++ on Windows

MemLeakTracker A single file drop-in memory leak tracking solution for C++ on Windows This small piece of code allows for global memory leak tracking

null 22 Apr 23, 2022