This is the mail archive of the
mailing list for the GDB project.
Re: gdb.Value instances created from python aren't released until the next command
- From: Tom Tromey <tromey at redhat dot com>
- To: Johan Erlandsson <jeoerl at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 12 Nov 2010 11:22:43 -0700
- Subject: Re: gdb.Value instances created from python aren't released until the next command
- References: <AANLkTimkpUEf9wtPH3F_yzJD94Y7CJhOgLsf91nx8fYs@mail.gmail.com>
>>>>> "Johan" == Johan Erlandsson <firstname.lastname@example.org> writes:
Johan> I have seen a problem with memory consumption when using python
Johan> scripts. In my case I work against a core dump and analys heap data
Johan> (performance is good and we can analys a lot of data).
Johan> As I see it there shouldn't be any reason for it to consume memory as
Johan> long as the Python instances are released.
Johan> Also I see the same pattern for non-python commands. Is this how it is
Johan> intended to work? Can you see any other way how to make it work?
It does currently work the way you described. It would be nice if it
were more efficient.
Maybe we could have a variant of value_to_value_object, used in most of
py-value.c, that also called release_value on the value. The comment in
front of value_to_value_object already claims to do this, but that is
probably a leftover from an earlier implementation of value reference
counting. I'm not certain whether it is always safe to call
release_value from there.