public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Chris January <chris.january@allinea.com>
To: gdb@sourceware.org
Subject: Re: Multiple inferiors and memory consumption
Date: Tue, 10 Jul 2012 08:04:00 -0000	[thread overview]
Message-ID: <1341907434.2162.5.camel@gumtree> (raw)
In-Reply-To: <4FFB3F86.2000109@codesourcery.com>

On Tue, 2012-07-10 at 00:31 +0400, Vladimir Prus wrote:
> It could be me, but I always expected that using GDB multi-process functionality should be better than
> separate GDB instances -- including memory consumption. So, I've just tried to run CVS gdb on itself
> inside 4 inferiors, and it looks like each inferior, the amount of data used by GDB (the DATA column
> in top) grows pretty much linearly. That is, it does not seem like GDB notices that symbol tables of
> all 4 loaded executables are identical (There's a link to the chart: http://goo.gl/0auVf)

We ran across the same problem some time back. There is a comment in
objfiles.h:

FIXME:  There is a problem here if the objfile is reusable, and if
        multiple users are to be supported.  The problem is that the 

so it looks like at least one person has thought about re-using objfile
in the past.

We have a patch that allows multiple programs_spaces to share the same
objfiles by moving the linked list entry into a new struct
objfile_instance.

> And now for my real question -- is there any case when using
> multi-process to debug several applications
> not related via parent-child relationship is better than running N
> copies of GDB?

Most of the time, no. If you are debugging so many processes that the
per GDB memory overhead is starting to hurt then yes, but only if you
are sharing symbol files between inferiors as above.

Regards,
Chris January


  parent reply	other threads:[~2012-07-10  8:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 20:31 Vladimir Prus
2012-07-10  2:29 ` Tom Tromey
2012-07-10  4:55   ` Vladimir Prus
2012-07-10 19:12     ` Tom Tromey
2012-07-10  8:04 ` Chris January [this message]
2012-07-10 19:09   ` Tom Tromey
2012-07-12 11:01     ` Chris January
2012-07-10 20:35 ` Marc Khouzam
2012-07-10 20:59   ` Paul_Koning
2012-07-10 21:06   ` Vladimir Prus

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=1341907434.2162.5.camel@gumtree \
    --to=chris.january@allinea.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).