From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14034 invoked by alias); 2 Mar 2011 11:36:58 -0000 Received: (qmail 13906 invoked by uid 22791); 2 Mar 2011 11:36:57 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Mar 2011 11:36:54 +0000 From: "joachim.protze at zih dot tu-dresden.de" To: gdb-prs@sourceware.org Subject: [Bug python/12533] New: gdb consumes large memory when millions gdb.values are created X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joachim.protze at zih dot tu-dresden.de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 02 Mar 2011 11:36:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q1/txt/msg00169.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12533 Summary: gdb consumes large memory when millions gdb.values are created Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: python AssignedTo: unassigned@sourceware.org ReportedBy: joachim.protze@zih.tu-dresden.de For my current pretty-printer project i collect some metadata in inferior space. This is used to evaluate, how some values - especially send/recv-buffers - should be formated for printout. In some cases it is necessary to evaluate metadata for each single value in buffer, which can be 10k+ values. I observed gdb to consume hundreds of MB memory and tried to analyze the source of the problem with valgrind + massif: most memory is consumed within allocate_value() What i don't understand: why are the value structures not freed while the command is running. Is this an issue of the python interpreter or is this an issue of the gdb-py api? Is there a way to get the values freed? ----------------------------------------- short example to see this behaviour (for RAM <2GB use smaller iteration counts!): (gdb) python v=gdb.parse_and_eval("1") (gdb) python >for i in range(1000000): > v+=1 >end (gdb) python >for i in range(1200000): > v+=1 >end (gdb) gdb consumes 600MB after the 1.0M iterations and 780MB after the 1.2M iterations -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.