GithubHelp home page GithubHelp logo

qiongsiwu / mstat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bpowers/mstat

0.0 1.0 1.0 3.21 MB

fine-grained, cgroup-based tool for profiling memory usage over time of a process tree

License: ISC License

Makefile 5.17% Go 91.66% Dockerfile 3.17%

mstat's Introduction

mstat -- measure memory usage of a program over time

This tool runs on Linux, taking advantage of the cgroups kernel API (also used by container infrastructure like Docker) to record memory usage of a set of processes over time. Because mstat builds on groups, we automatically track memory usage of any child-processes spawned by the original program.

Additionally, the Memory API we are using not only gives us detailed information about userspace memory usage, but also about kernel memory allocated on behalf of the program. (such as memory used to mange a process's page tables).

This tool only runs on Linux, and requires being installed installed set-UID. Build it the normal way:

$ git clone https://github.com/bpowers/mstat
$ cd mstat
$ make; sudo make install

Then, use it to measure memory usage over time (freq specifies the sampling frequency in Hz, bump it up for short-lived programs or fine grained reporting):

$ mstat -o data/mem.tsv -freq 59 -- ./test

And there is even a handy flag to modify the environment:

$ mstat -o data/mem.tsv -freq 59 -env LD_PRELOAD=libawesome.so -- ./test

Use mstat without Docker

Prerequisite:

After installing golang and cloning this repository, download all the go dependencies with the command

$ cd mstat
$ go get -d ./...

Then proceed with make and installation. If you want to be able to uninstall mstat later, instead of using make install, use the command below

$ sudo checkinstall

You will be able to uninstall mstat by running

$ sudo dpkg -r mstat

later.

mstat's People

Contributors

bpowers avatar qiongsiwu avatar

Watchers

 avatar

Forkers

suraj44

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.