Skip to content

turtle261/heapred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heapred

heapred measures live glibc-visible heap-state compressibility by freezing a target process at capture times, reconstructing the live heap from an append-only committed allocation log, serializing a canonical heap stream, and compressing that stream with ZPAQ

Components

  • libheapred_preload.so: C interposer loaded through LD_PRELOAD.
  • heapred: C++ collector CLI.

Build

Dependencies: Linux, glibc, gcc (including g++), awk, make, and bash

make
# make test

CLI

./heapred run --times 1s,2s --methods 1,4 -- ./target args
./heapred run --every 500ms --methods 4 -- ./target args
./heapred analyze run/snapshots/0001_t1.000000000 --methods 1,4
./heapred report run

Snapshot Layout

Each snapshot directory contains:

  • snapshot.json
  • events.state.json
  • blocks.jsonl
  • heap-stream.bin
  • heap-stream.sha256
  • compression/zpaq-<method>.json

Heap Stream

Blocks are ordered by ascending alloc_id and encoded as:

  1. 8-byte little-endian size
  2. exactly size payload bytes

No pointer/address metadata is included in the canonical stream.

Limitations (at least for now)

  • Only glibc-wrapped heap allocations are measured.
  • Direct mmap performed by the application is excluded.
  • Static binaries are unsupported.
  • Snapshot time is the first frozen state at or after requested time (not instruction-exact).
  • Compression results depend on encoding and selected compressor method.

License

This is free software available under the ISC License. Read the ./LICENSE file completely.

About

Capture the Heap state at specified intervals, and measure the compressed size thereof.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages