Generate image plots of processes' memory usage very quickly, within a single binary.

memplot

A small utility written in golang to quickly plot memory usage of processes. memplot constantly samples memory usage of a process, for a given amount of time and then outputs an image file. Painless and straightforward. Supported image extensions are: .eps, .jpg, .jpeg, .pdf, .png, .svg, .tex, .tif and .tiff

Installation

Binaries for Linux and MacOS are available in the releases page

go get -u -v github.com/0x0f0f0f/memplot/cmd/memplot

Usage

Usage of memplot:
Arguments following options will be interpreted as the command to spawn and sample
  -dur duration
    	total profiling time. a value of 0 means that the program
    	will be sampled until it is no longer running
  -height string
    	plot image height (can be cm or in) (default "12cm")
  -o string
    	output image file name. supported extensions are:
    	.eps, .jpg, .jpeg, .pdf, .png, .svg, .tex, .tif and .tiff
    	(default "output-plot.png")
  -pid int
    	pid of the process to analyze (default -1)
  -sd duration
    	sample size in time (default 5ms)
  -vsz
    	plot virtual size
  -width string
    	plot image width (can be cm or in) (default "16cm")

Example Plot

memplot -pid 25273 -width 8in -height 8in -dur 60s -sd 50ms -o plot.png

or

memplot -width 8in -height 8in -dur 60s -sd 50ms -o plot.png firefox

Roadmap

  • Plot other useful values
  • Colors
  • Option to change the font
  • Memory autoscaling
  • Spawn child processes to sample
Owner
Alessandro
CS Student, PLer
Alessandro
Similar Resources

Very simple SVG to PNG converter library using the Inkscape.

svg2png Description Very simple SVG to PNG converter library using the Inkscape.

Jan 11, 2022

A (very) simple graph package that utilizes the Generics features in Go 1.18

A (very) simple graph package that utilizes the Generics features in Go 1.18

May 11, 2022

Merge multiple pprof profile files into a single file

pprof-merge Merges multiple pprof profile files into one. Installation $ go get github.com/rakyll/pprof-merge Usage $ pprof-merge profile1.data profi

Dec 15, 2022

A Free 8-Bit Sprite Generator. Create 256 variants from a single template .PNG

A Free 8-Bit Sprite Generator.  Create 256 variants from a single template .PNG

BitSprite A Free 8-Bit Sprite Generator. What? BitSprite is a program that creates variants of an image across total sprite sheet of the resultant ima

Sep 20, 2022

Go-binsize-treemap - Go binary size SVG treemap

🔍 Go binary size SVG treemap Make treemap breakdown of Go executable binary $ g

Dec 21, 2022

Geocache is an in-memory cache that is suitable for geolocation based applications.

Geocache is an in-memory cache that is suitable for geolocation based applications.

geocache geocache is an in-memory cache that is suitable for geolocation based applications. It uses geolocation as a key for storing items. You can s

Oct 27, 2022

Image processing algorithms in pure Go

Image processing algorithms in pure Go

bild A collection of parallel image processing algorithms in pure Go. The aim of this project is simplicity in use and development over absolute high

Jan 6, 2023

Go package for fast high-level image processing powered by libvips C library

bimg Small Go package for fast high-level image processing using libvips via C bindings, providing a simple programmatic API. bimg was designed to be

Jan 2, 2023

Image processing library and rendering toolkit for Go.

blend Image processing library and rendering toolkit for Go. (WIP) Installation: This library is compatible with Go1. go get github.com/phrozen/blend

Nov 11, 2022
Comments
  • panic if the spawned command exits with a non-zero exit code

    panic if the spawned command exits with a non-zero exit code

    Hey, loving the improvements! The auto-spawning a command makes it much easier to use, and the SVG output option lets you zoom in a let a closer look.

    I found a panic though. If the spawned command exits with a non-zero exit code, memplot panics:

    panic: exit status 64
    
    goroutine 18 [running]:
    main.check(...)
    	/home/runner/work/memplot/memplot/cmd/memplot.go:16
    main.main.func2(0xc000012090, 0x3, 0x3, 0xc00018e000)
    	/home/runner/work/memplot/memplot/cmd/memplot.go:86 +0xfe
    created by main.main
    	/home/runner/work/memplot/memplot/cmd/memplot.go:80 +0x4e8
    
  • Installation installs memplot as

    Installation installs memplot as "cmd"

    Installation instructions are:

    go get -u -v github.com/0x0f0f0f/memplot/cmd
    

    ...this installs a binary called "cmd", much like if you cd to that dir. and "go build". Usual layout I use is:

    github.com/<user>/<repo>/cmd/memplot/memplot.go
    

    ...then:

    go get -u -v github.com/0x0f0f0f/memplot/cmd/memplot
    

    ..will give you a memplot binary. There might be a more efficient way to do this but, I keep using the same thing because it works :).

Related tags
🔍 Go tool for LSB steganography, capable of hiding any file within an image.
🔍 Go tool for LSB steganography, capable of hiding any file within an image.

stegify Overview stegify is a simple command line tool capable of fully transparent hiding any file within an image or set of images. This technique i

Jan 1, 2023
Turn a grid of frames (stored in a single image) into a video file
Turn a grid of frames (stored in a single image) into a video file

reel2vid Convert a video that is encoded into one large image as many images sid

Dec 19, 2021
darkroom - An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency.
darkroom - An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency.

Darkroom - Yet Another Image Proxy Introduction Darkroom combines the storage backend and the image processor and acts as an Image Proxy on your image

Dec 6, 2022
Easily customizable Social image (or Open graph image) generator

fancycard Easily customizable Social image (or Open graph image) generator Built with Go, Gin, GoQuery and Chromedp Build & Run Simply, Clone this rep

Jan 14, 2022
An API which allows you to upload an image and responds with the same image, stripped of EXIF data

strip-metadata This is an API which allows you to upload an image and responds with the same image, stripped of EXIF data. How to run You need to have

Nov 25, 2021
Imgpreview - Tiny image previews for HTML while the original image is loading
Imgpreview - Tiny image previews for HTML while the original image is loading

imgpreview This is a Go program that generates tiny blurry previews for images t

May 22, 2022
Generate a TwitterCard(OGP) image for your Hugo posts.
Generate a TwitterCard(OGP) image for your Hugo posts.

Twitter Card Image Generator Generate Twitter card (OGP) images for your blog posts. Supported front-matters are title, author, categories, tags, and

Dec 17, 2022
code2img can generate image of source code
code2img can generate image of source code

code2img code2img can generate image of source code. This was inspired by carbon and silicon Features Doesn't need browser & Internet Copy image of so

Nov 15, 2022
API for generate image to ASCII Art

ASCII API Generate ASCII art from image. You can try this API here: ascii.projec

Jul 1, 2022
Canvas is a Go drawing library based on OpenGL or using software rendering that is very similar to the HTML5 canvas API
Canvas is a Go drawing library based on OpenGL or using software rendering that is very similar to the HTML5 canvas API

Go canvas Canvas is a pure Go library that provides drawing functionality as similar as possible to the HTML5 canvas API. It has nothing to do with HT

Jan 3, 2023