From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16278 invoked by alias); 10 Apr 2007 14:36:47 -0000 Received: (qmail 16269 invoked by uid 22791); 10 Apr 2007 14:36:46 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.225) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Apr 2007 15:36:32 +0100 Received: by nz-out-0506.google.com with SMTP id m7so1362708nzf for ; Tue, 10 Apr 2007 07:36:30 -0700 (PDT) Received: by 10.115.106.7 with SMTP id i7mr2820513wam.1176215789780; Tue, 10 Apr 2007 07:36:29 -0700 (PDT) Received: by 10.114.14.15 with HTTP; Tue, 10 Apr 2007 07:36:29 -0700 (PDT) Message-ID: <22080b0a0704100736u77ecd68ahddcfabad8ab964d4@mail.gmail.com> Date: Tue, 10 Apr 2007 14:36:00 -0000 From: "Ravi Ramaseshan" To: "Mark Kettenis" Subject: Re: GDB STL Memory Usage Issue Cc: gdb@sourceware.org In-Reply-To: <200704100816.l3A8GQ4v022748@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <22080b0a0704091640k3df4efd8h43a32df9ee48110@mail.gmail.com> <200704100816.l3A8GQ4v022748@brahms.sibelius.xs4all.nl> 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/msg00050.txt.bz2 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. -- Ravi Ramaseshan http://www.geocities.com/ramaseshan_ravi/ " Reality is only something we believe in strongly. "