nndhawan
nndhawan

Reputation: 617

How to see Valgrind Massif output (or other heap profiler) as program executes?

When using Valgrind Massif in LINUX, I tried to see the massif.out.pid file in real time but it produces this file after Massif finished executing. I want to place breakpoints in the code to watch the effect certain instructions have on the heap as there are only a few points of interest. I know I could rewrite some of the code to manage this but this means influencing the subject code in a way that won't be the final result as well that their is numerous programs I want to do this on. Is there a way to watch points in the code while watching the profiler profile the heap at the same time, so I can distinguish between points of execution?

Upvotes: 0

Views: 2475

Answers (3)

jdenozi
jdenozi

Reputation: 212

Maybe it's a bit late, but massif-visualizer is the tool you looking for : massif-visualizer

Upvotes: 0

Woochan Lee
Woochan Lee

Reputation: 176

Write sleep(0.5) in the code where you want to see the memory heap usage. then execute application with heaptrack ./app and then open the result file with heaptrack_gui app.heaptrack.gz

go to consumed tap and check the memory usage by time line.

Upvotes: 0

nndhawan
nndhawan

Reputation: 617

Apparently there is a tool in Linux that can give real time data, I haven't tried it out but found it after additional google searching. Its called heaptrack and apparently it can track the heap while the program is running:

http://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux

Upvotes: 1

Related Questions