public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/12533] New: gdb consumes large memory when millions gdb.values are created
@ 2011-03-02 11:36 joachim.protze at zih dot tu-dresden.de
  2011-11-23 21:09 ` [Bug python/12533] " tromey at redhat dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: joachim.protze at zih dot tu-dresden.de @ 2011-03-02 11:36 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-27 22:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 11:36 [Bug python/12533] New: gdb consumes large memory when millions gdb.values are created joachim.protze at zih dot tu-dresden.de
2011-11-23 21:09 ` [Bug python/12533] " tromey at redhat dot com
2011-12-02 18:02 ` tromey at redhat dot com
2011-12-08 19:00 ` ian at mahuron dot org
2011-12-22 19:52 ` cvs-commit at gcc dot gnu.org
2011-12-22 19:53 ` tromey at redhat dot com
2011-12-22 21:34 ` ian at mahuron dot org
2011-12-23  2:46 ` tromey at redhat dot com
2012-01-03 19:28 ` cvs-commit at gcc dot gnu.org
2012-01-03 19:30 ` tromey at redhat dot com
2012-01-03 19:44 ` ian at mahuron dot org
2023-02-27 22:56 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).