From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18460 invoked by alias); 6 May 2008 17:56:59 -0000 Received: (qmail 18451 invoked by uid 22791); 6 May 2008 17:56:59 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 06 May 2008 17:56:39 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id A2ECD9835A; Tue, 6 May 2008 17:56:37 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 7A03A980F7; Tue, 6 May 2008 17:56:37 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JtRP2-0008NO-Lg; Tue, 06 May 2008 13:56:36 -0400 Date: Tue, 06 May 2008 18:50:00 -0000 From: Daniel Jacobowitz To: Aleksandar Ristovski Cc: gdb-patches@sourceware.org Subject: Re: [patch] Do not add partial_symbol again and again to the list Message-ID: <20080506175636.GA31803@caradoc.them.org> Mail-Followup-To: Aleksandar Ristovski , gdb-patches@sourceware.org References: <20080211214750.GA1953@caradoc.them.org> <47B0C7C6.9090605@qnx.com> <20080211223056.GA3833@caradoc.them.org> <47B0CF8A.6080306@qnx.com> <20080211225314.GA5832@caradoc.them.org> <47B27EB1.6030606@qnx.com> <20080503205413.GA22704@caradoc.them.org> <481F58ED.5070207@qnx.com> <20080506141754.GA17275@caradoc.them.org> <48209891.3000400@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48209891.3000400@qnx.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00245.txt.bz2 On Tue, May 06, 2008 at 01:42:41PM -0400, Aleksandar Ristovski wrote: > I am not, however, happy with the patch completely - I think we can > optimize it a bit more. Both struct partial_symbol and struct symbol > are space critical and we should save everything we (reasonably) > can. > > My "feeling" is that we could use struct symbol for both, populate > only the "partial_symbol" portion and then, as we load full symbols, > "promote" the existing allocated structures to full symbols; some > operations would not repeat (like name construction or > fixup_[p]?symbol_section); initial memory allocation would be > greater, but in the long run I would expect that gdb would use less > memory than it does now. Savings I am hoping to see from such > approach are: overall lower memory consumption, much lower number of > memory alloc's, and saving some redundant operations we do for both > psyms and syms. A symbol is about twice as big as a psymbol. So this would only lead to less overall memory if we loaded more than half the full symbols in an average debugging session. I just don't think that's true. It's probably more like 5%. And the bcache allows psymbols that look the same to use the same memory. It's hugely effective - check maint print statistics. No two symbols can share memory for various reasons. For instance, two global functions will have different block pointers. > Or, maybe, we could go step by step: commit this patch (providing > you find it good enough) and then continue with more extensive > changes? I think we should finish up this patch, and then proceed from there. Should we use this optimization for all global psymtabs? If so, then we ought to do it in common code so that all the other symbol readers, like stabs, benefit. -- Daniel Jacobowitz CodeSourcery