From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22164 invoked by alias); 10 Jul 2012 08:04:17 -0000 Received: (qmail 22146 invoked by uid 22791); 10 Jul 2012 08:04:13 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=BAYES_00,KHOP_THREADED,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.allinea.com (HELO mail.allinea.com) (94.125.131.200) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 08:03:57 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.allinea.com (Postfix) with ESMTP id 68F5312FC12 for ; Tue, 10 Jul 2012 09:03:55 +0100 (BST) Received: from mail.allinea.com ([127.0.0.1]) by localhost (mail.allinea.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VKCbpAehhUSk for ; Tue, 10 Jul 2012 09:03:55 +0100 (BST) Received: from [192.168.0.6] (cpc16-sotn11-2-0-cust109.15-1.cable.virginmedia.com [82.10.182.110]) (Authenticated sender: cjanuary) by mail.allinea.com (Postfix) with ESMTPSA id 045CA12E0B9 for ; Tue, 10 Jul 2012 09:03:54 +0100 (BST) Message-ID: <1341907434.2162.5.camel@gumtree> Subject: Re: Multiple inferiors and memory consumption From: Chris January To: gdb@sourceware.org Date: Tue, 10 Jul 2012 08:04:00 -0000 In-Reply-To: <4FFB3F86.2000109@codesourcery.com> References: <4FFB3F86.2000109@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00012.txt.bz2 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