From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19844 invoked by alias); 10 Apr 2007 08:16:35 -0000 Received: (qmail 19835 invoked by uid 22791); 10 Apr 2007 08:16:35 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Apr 2007 09:16:32 +0100 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0) with ESMTP id l3A8GRMK023209; Tue, 10 Apr 2007 10:16:27 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0/Submit) id l3A8GQ4v022748; Tue, 10 Apr 2007 10:16:27 +0200 (CEST) Date: Tue, 10 Apr 2007 08:16:00 -0000 Message-Id: <200704100816.l3A8GQ4v022748@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: ramaseshan.ravi@gmail.com CC: gdb@sourceware.org In-reply-to: <22080b0a0704091640k3df4efd8h43a32df9ee48110@mail.gmail.com> (ramaseshan.ravi@gmail.com) Subject: Re: GDB STL Memory Usage Issue References: <22080b0a0704091640k3df4efd8h43a32df9ee48110@mail.gmail.com> 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/msg00048.txt.bz2 > 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.