From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kmswv-0003c2-SG for qemu-devel@nongnu.org; Mon, 06 Oct 2008 12:28:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kmswt-0003Z7-VT for qemu-devel@nongnu.org; Mon, 06 Oct 2008 12:28:45 -0400 Received: from [199.232.76.173] (port=53992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kmswt-0003Yp-NA for qemu-devel@nongnu.org; Mon, 06 Oct 2008 12:28:43 -0400 Received: from rn-out-0910.google.com ([64.233.170.184]:5492) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kmswt-0005yW-IZ for qemu-devel@nongnu.org; Mon, 06 Oct 2008 12:28:43 -0400 Received: by rn-out-0910.google.com with SMTP id m61so2143810rnd.8 for ; Mon, 06 Oct 2008 09:28:42 -0700 (PDT) Message-ID: <761ea48b0810060928p5f97e03cx7c43cbc1a75a0d6a@mail.gmail.com> Date: Mon, 6 Oct 2008 18:28:41 +0200 From: "Laurent Desnogues" Subject: Re: Hash table based symbol lookup (was: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <761ea48b0810060329l5d05315euea009eb97d22799b@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Oct 6, 2008 at 6:11 PM, Blue Swirl wrote: > > I hope I'm wrong, but it looks like in the worst case, for each byte > that the symbol covers, this implementation can allocate a structure > of tens of bytes in size. I wonder what the symbols of 1.5MB > openbios-sparc64 would take. No, you're right: for each byte of a function a structure of about 5 * ptr size is allocated. In your case, that'd be about 60 MB. It's bad and can probably be reduced. But just try to run in debug mode (-d) any application that has thousands of symbols and you'll soon see you have to disable symbol lookup as its complexity is linear. I can reduce memory consumption but its size will still be a multiple of the text segment size. Laurent