Giter Site home page Giter Site logo

yodaos-project / malldump Goto Github PK

View Code? Open in Web Editor NEW
28.0 9.0 6.0 59 KB

Attach to a process and dump statistics of low level malloc(ptmalloc, the glibc implementation) of the process.

License: Apache License 2.0

CMake 6.62% C 90.28% Shell 3.10%
ptmalloc malloc mallocdump heapdump

malldump's Introduction

Malldump

Build Status

Attach to a process and dump statistics of low level malloc(ptmalloc, the glibc implementation) of the process.

Supported malloc implementations

  • ptmalloc, also known as ptmalloc2

Supported platforms

  • Linux

Supported architectures

  • x86_64
  • aarch64
  • arm

Build

mkdir build && cd build
cmake .. && make

Usage

usage:
  -h           print this usage
  -D           debug mode [defaut: false]
  -t <arg>     type of malloc [default: ptmalloc]
  -p <arg>     pid of the target process
  -I <arg>     offset of mallinfo [default: ...]
  -P <arg>     offset of mp_ [default: ...]
  -A <arg>     offset of narenas [default: ...]
  -H           display size of memory in human mode [default: false]
malldump -H -p <pid>

Outputs

Process cmd:    nmap -sP 172.17.0.0/16
Process pid:    49457
Threads:        1
Arenas:         1
Total memory:   10248.0K
Avail memory:   403.1K
Used memory:    9844.9K
Used memory%:   96.07%
Free chunks:    2
Fastbin chunks: 3
Fastbin memory: 0.2K
Mmapped chunks: 1
Mmapped memory: 516.0K
Trim threshold: 128.0K
Mmap threshold: 128.0K
Arena max:      16
  • Arenas: Number of created arenas.
  • Total memory: Total memory that allocated from OS through brk() or mmap().
  • Avail memory: Memory that kept by low level malloc but not used by application.
  • Used memory: Memory that used by application through malloc().
  • Used memory%: used memory / total memory.
  • Free chunks: Chunks that linked in the double-linked list of bins except fastbins.
  • Fastbin chunks: Chunks that linked in the single-linked list of fastbins.
  • Mmapped chunks: Chunks that allocated from OS directly by mmap().
  • Mmapped memory: Total memory of mmapped chunks.
  • Trim threshold: The maximum amount of unused top-most memory to keep before releasing via malloc_trim in free().
  • Mmap_threshold: The request size threshold for using mmap() to service a request. Requests of at least this size that cannot be allocated using already-existing space will be serviced via mmap.
  • Arena max: The maximum number of arenas. If not set manually, the default formula is nr_cpu * (sizeof(long) == 4 ? 2 : 8).

malldump's People

Contributors

yonzkon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.