Coder Social home page Coder Social logo

memgraphinator's Introduction

memgraphinator

I want a tool to draw the memory usage graph of a given process over time. I want to see memory leaks.

I couldn't find one so I started writing my own.

image

Usage

./memgraphinator.py [--exit-when-process-dies]
./memgraphinator.py [--exit-when-process-dies] [-p|--pid] PID ...
./memgraphinator.py [--exit-when-process-dies] [--] command [args ...]
./memgraphinator.py -h|--help
positional arguments:

command [args] Command to execute and monitor

optional arguments:

-h, --help Show this help message and exit -p PID, --pid PID Specify existing process to monitor --exit-when-process-dies Exit when monitored process dies

Requirements

  • Linux (for /proc/{pid}/status)
  • Python
  • PyGObject with GIR libraries for GTK etc.

Note

On Ubuntu be sure to apt-get install python3-gi python3-gi-cairo gir1.2-gtk-3

  • A reasonably new GTK+ (3.10 is fine but 3.12 is preferred)

Future plans

  • Accurate time axis (when you suspend laptop, graph stops, but this is not reflected in "N seconds ago" messages)
  • Export graph to CSV

memgraphinator's People

Contributors

mgedmin avatar

Stargazers

Lion avatar  avatar  avatar Eduardo Silva avatar abrad1212 avatar  avatar Sam Caulfield avatar Kevin Darlington avatar Jason Papakostas avatar Ajit Peter avatar Fabian Frei avatar Philip Whitfield avatar Mykola Karnaukhov avatar Eddy Castillo avatar Alexander V. Nikolaev avatar Damon Dransfeld avatar

Watchers

 avatar Eduardo Silva avatar James Cloos avatar  avatar Mykola Karnaukhov avatar  avatar

Forkers

olivierh59500

memgraphinator's Issues

What do the 2 lines mean?

There are 2 graphs shown at once, they appear to follow each other, what do the 2 lines mean?

Not really an issue but an explanation should be added to the readme.

Idea: track PSS

In addition to RSS and VIRT it might be nice to track PSS (Proportional set size, like RSS except shared memory pages are divided by the number of processes that share them).

You can get it from /proc/$pid/smaps_rollup, on a line containing

Pss:                    nnn kB

(If smaps_rollup is not available, you'd have to read /proc/$pid/smaps itself and sum the Pss for every mapping. I'm not sure which kernel version added smaps_rollup.)

Feature request: Pause / Resume button

For debugging, I have inserted some cin.get() lines to stop program execution at a particular point.

It would be useful to have a "Pause/Continue" button so that the graph does not scroll off all the way to the left.

Alternatively a scroll bar on the x axis to scroll through the history of the data.

Really useful tool for quickly finding memory leaks by the way.

Time computation is incorrect

I had a script running for just under two hours, and when zoomed out, memgraphinator claimed I was looking at data points more than 3 hours in the past.

High CPU usage after a while

Leaving memgraphinator open for 20 hours (plotting gnome-shell's memory usage) makes it eat ~34% CPU all the time, unless you pause it (paused, it eats ~2.5% CPU).

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.