From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 982 invoked by alias); 3 Feb 2011 20:57:32 -0000 Received: (qmail 974 invoked by uid 22791); 3 Feb 2011 20:57:31 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Feb 2011 20:57:26 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p13KvFAb010153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Feb 2011 15:57:15 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p13KvElB008559; Thu, 3 Feb 2011 15:57:14 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p13KvDa2024582; Thu, 3 Feb 2011 15:57:13 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id AF44B378BA7; Thu, 3 Feb 2011 13:57:12 -0700 (MST) From: Tom Tromey To: Markus Alber Cc: Michael Snyder , Subject: Re: performance of multithreading gets gradually worse under gdb References: <8b62d2819c94a232987155aa99e01983@hyperion-imrt.org> <4D49BE4E.9000009@vmware.com> <76bccf1875854ebc69b6a892fb84a976@hyperion-imrt.org> <4D49D016.7000607@vmware.com> <0e69c90ce85e34a24a5bcef1ce391aae@hyperion-imrt.org> Date: Thu, 03 Feb 2011 20:57:00 -0000 In-Reply-To: <0e69c90ce85e34a24a5bcef1ce391aae@hyperion-imrt.org> (Markus Alber's message of "Thu, 03 Feb 2011 08:02:57 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2011-02/txt/msg00018.txt.bz2 >>>>> "Markus" == Markus Alber writes: Markus> See the attached file. It shows a similar behaviour, although it only Markus> allocates 8kB per iteration. Markus> You have to wait some time before this happens. Thanks. I changed 1<<24 to 1<<15, to spare my underpowered machine, and ran gdb under massif. This part is interesting: ->20.78% (2,954,016B) 0x8253683: regcache_xmalloc_1 (regcache.c:232) | ->20.78% (2,954,016B) 0x8253F85: get_thread_arch_regcache (regcache.c:463) | ->20.78% (2,954,016B) 0x82540B5: get_thread_regcache (regcache.c:488) | ->20.78% (2,954,016B) 0x81D1579: i386_linux_resume (i386-linux-nat.c:861) | | ->20.78% (2,954,016B) 0x81D7D32: linux_nat_resume (linux-nat.c:1983) I debugged gdb a little and it does indeed seem to be leaking here. I don't understand why registers_changed_ptid unconditionally clears current_regcache. I suspect that may be the source of the problem. Perhaps someone who knows this code better could take a look. Tom