Realtime memory monitor crap tool

Last night I wrote about a little tool for real-time monitoring of the memory consumption of a piece of software.

You can find it here. If you untar that you’ll find a valgrind_massif_ms_main.diff which you’ll have to apply to valgrinds massif tool release 3.1.1 (it’s the latest version on their website). I didn’t cleanup the crap code. So the code is as ugly as can be.

Oh by the way. Using it to monitor evolutions memory consumption gives funny results.

Showing “massif.PID.ps”-like memory usage while running your software

I wanted to see how tinymail consumes memory in real time.

By that I mean, let my system give me (the developer) a graphical idea of how much memory the software is using if I perform a specific action. And to check whether or not I’m getting the memory back when I’m done with the action. However. Not after a full session by viewing a .ps file. This is what a standard valgrind/massif makes possible.

No, I wanted to ‘see’ the curve grow ‘while’ running my software.

For example when I open a folder, I expect memory usage to grow. If I now click on an empty folder, I expect the memory usage to drop (because the first folder is now being uncached).

So I hacked massif a little bit and wrote a little Gtk+ tool that reads the information from massif and plots it to a drawingarea. It’s not really in a usable state but I created a screencast to give you guys the basic idea. It’s a 3.3 MB GIF animation which will eat your memory if you use Firefox for viewing it. But it’ll work.

I don’t know when nor if I’ll ever get this funny thingy in a usable state. Note that you also need a few small changes to the massif ‘ms_main.c‘ file. And the tool is a quick-put-together glade-2 generated piece of crap code at this moment. Oh bleh, I’ll probably make it usable. It’s just a little bit late now. And I have to go to work/my customer tomorrow. I hack to much late at night :-). So I already told myself I’m not going to finish it tonight. Don’t ask!