From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31075 invoked by alias); 11 Apr 2007 08:21:13 -0000 Received: (qmail 31067 invoked by uid 22791); 11 Apr 2007 08:21:13 -0000 X-Spam-Check-By: sourceware.org Received: from tidos.tid.es (HELO correo.tid.es) (193.145.240.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Apr 2007 09:21:10 +0100 Received: from tid (filvit [192.168.48.202]) by tid.hi.inet (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0JGB005NRR77WY@tid.hi.inet> for gdb@sourceware.org; Wed, 11 Apr 2007 10:21:07 +0200 (MEST) Received: from dacha.hi.inet (dacha.hi.inet [10.95.11.233]) by tid.hi.inet (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTPA id <0JGB004IWR770V@tid.hi.inet> for gdb@sourceware.org; Wed, 11 Apr 2007 10:21:07 +0200 (MEST) Date: Wed, 11 Apr 2007 08:21:00 -0000 From: =?ISO-8859-1?Q?=C1lvaro?= Vega =?ISO-8859-1?Q?Garc=EDa?= Subject: Re: GDB STL Memory Usage Issue In-reply-to: <22080b0a0704100736u77ecd68ahddcfabad8ab964d4@mail.gmail.com> To: gdb@sourceware.org Message-id: <1176279667.3912.15.camel@dacha.hi.inet> MIME-version: 1.0 X-Mailer: Evolution 2.6.3 Content-type: text/plain; charset=ISO-8859-15 Content-transfer-encoding: 8BIT References: <22080b0a0704091640k3df4efd8h43a32df9ee48110@mail.gmail.com> <200704100816.l3A8GQ4v022748@brahms.sibelius.xs4all.nl> <22080b0a0704100736u77ecd68ahddcfabad8ab964d4@mail.gmail.com> 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: 2007-04/txt/msg00061.txt.bz2 Hi, On Tue, 2007-04-10 at 10:36 -0400, Ravi Ramaseshan wrote: > On 4/10/07, Mark Kettenis wrote: > > > Date: Mon, 9 Apr 2007 19:40:58 -0400 > > > From: "Ravi Ramaseshan" > > > > > > Hi, > > > > > > I observed some strange behavior with the following system that I > > > would like to know more about: > > > > > > I'm compiling a very memory intensive C++ application that uses STL > > > (hashmaps of lists). Every few seconds I erase() the entire hashmap > > > (and the lists). When I run the program standalone and examine the > > > memory usage using top, I see the total virtual memory of the program > > > grow (sometimes to 60+MB) before the erase call and after the erase > > > call drop down to a few MB - which is the behavior I would expect. > > > > > > However, when I run the same program through GDB, the erase() does not > > > seem to have any effect and the virtual memory usage keeps on rising - > > > which I do not understand. > > > > > > I am using GCC 4.0.3, GDB 6.4 and am compiling the program with > > > debugging information. I would like to understand the reasons for such > > > a behavior of my program under GDB. > > > > > > Thanks in advance, > > > > Smells like an operating system bug to me. > > > > > > I am running an Ubuntu system 2.6.15-28-686 kernel, if that helps > anyone explain the problem I observed. > Make sure your compiler version is the same than the execution versión libreries (see your LD_LIBRARY_PATH). I have been experimented similar problems when a project was compiled with GCC 3.4 and executed with gcc 4.1 dynamic libraries. Redards, Álvaro