From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Alex Lindsay <alexlindsay239@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Large memory usage by gdb
Date: Mon, 07 Aug 2017 18:19:00 -0000 [thread overview]
Message-ID: <1502129972.1467.13.camel@skynet.be> (raw)
In-Reply-To: <420b109c-1610-d687-ae9a-b172542fafca@gmail.com>
On Fri, 2017-08-04 at 16:14 -0500, Alex Lindsay wrote:
> So I wanted to share what I've been doing to make sure that I'm not
> wasting my time (or the list's).
For sure, fixing leaks is not wasted time.
> Since this is my first deep dive into valgrind, I started "simple".
> I've been running more or less:
> valgrind --xtree-leak=yes gdb --args ./hello
If you are only interested in leaks (definite and/or possible leaks)
and you do not have zillions of different leaks, then using
the classical text output for leak search might be easier.
If you use kcachegrind to visualise xtree leak reports,
you might have to tune the way the graph is shown by using
menus in the graph such as:
right click -> Graph -> Caller Depth -> ...
-> Callee Depth -> ...
-> Min Node Cost -> ...
Once the leaks are solved, then to visualise the increase
of memory caused by a run in gdb, you might do (from a shell) :
vgdb leak_check xtleak kinds all any
In kcachegrind, you can then analyse various 'events'
(typically for your case, you might look first at
'increase Reachable Bytes'
Alternatively, to see memory increase in a textual output,
you might do:
vgdb leak_check full kinds all increased
(if output too large, you can add
limited 100
after increased
to output only the 100 (or whatever nr) 'biggest increase'.
Philippe
next prev parent reply other threads:[~2017-08-07 18:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 20:20 Alex Lindsay
2017-07-25 20:28 ` Philippe Waroquiers
2017-07-31 22:11 ` Alex Lindsay
2017-08-01 19:12 ` Philippe Waroquiers
[not found] ` <420b109c-1610-d687-ae9a-b172542fafca@gmail.com>
2017-08-04 21:43 ` Alex Lindsay
2017-08-07 9:16 ` Yao Qi
2017-08-07 19:53 ` Philippe Waroquiers
2017-08-07 21:04 ` Alex Lindsay
2017-08-07 21:34 ` Simon Marchi
2017-08-07 18:19 ` Philippe Waroquiers [this message]
2017-07-26 7:28 ` Yao Qi
[not found] ` <4fc14853-b066-4fd7-f0c9-b98f442a9a95@gmail.com>
2017-07-26 15:55 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502129972.1467.13.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=alexlindsay239@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox