Chaitanya
Chaitanya

Reputation: 3469

writing heap summary to file in valgrind

I am using valgrind's memcheck to monitor my program. The heap summary generated is big in size to atleast copy.

How can I copy the heap summary stuff into a file in Valgrind.

Thanks in advance. :)

Upvotes: 0

Views: 359

Answers (1)

phd
phd

Reputation: 91

Valgrind has multiple ways to redirect its output.

  1. to a file valgrind --log-file=valgrind.out --leak-check=full yourapp

  2. to any file descriptor. valgrind --log-fd=123 --leak-check=full yourapp 123>valgrind.out

  3. to an ipaddr/port nr valgrind --log-socket=

You can also redirect valgrind output to a ipaddr/port nr using --log-socket=ipaddr:port (you must then start valgrind-listener on this port).

Upvotes: 1

Related Questions