This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb.Value instances created from python aren't released until the next command

>>>>> "Johan" == Johan Erlandsson <> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]