From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4428 invoked by alias); 9 Apr 2007 23:41:03 -0000 Received: (qmail 4418 invoked by uid 22791); 9 Apr 2007 23:41:02 -0000 X-Spam-Check-By: sourceware.org Received: from wr-out-0506.google.com (HELO wr-out-0506.google.com) (64.233.184.235) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Apr 2007 00:41:00 +0100 Received: by wr-out-0506.google.com with SMTP id 70so1104119wra for ; Mon, 09 Apr 2007 16:40:59 -0700 (PDT) Received: by 10.114.197.1 with SMTP id u1mr2535060waf.1176162058748; Mon, 09 Apr 2007 16:40:58 -0700 (PDT) Received: by 10.114.14.15 with HTTP; Mon, 9 Apr 2007 16:40:58 -0700 (PDT) Message-ID: <22080b0a0704091640k3df4efd8h43a32df9ee48110@mail.gmail.com> Date: Mon, 09 Apr 2007 23:41:00 -0000 From: "Ravi Ramaseshan" To: gdb@sourceware.org Subject: GDB STL Memory Usage Issue MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/msg00047.txt.bz2 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, -- Ravi Ramaseshan http://www.geocities.com/ramaseshan_ravi/ " Reality is only something we believe in strongly. "