Re: question: python gc doesn't collect buffer allocated by read_memory()

Tom Tromey
2012-03-20T20:59:02Z

>>>>> ">" == HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> writes:

>> count = 100000
>> while count >= 0:
>> i.read_memory(buf.address, buf.type.sizeof)
>> count -= 1

You don't say what version of gdb you are using.
What you are reporting sounds like PR 12533, which was fixed in CVS back
in January.

>> 5. Looking at referrers of the buffer returned by read_memory(), they
>> are all empty [], so it looks OK to me if garbage collector collects
>> the memory...

In 12533 the problem was that intermediate values weren't properly
deallocated.

You could test for this problem by hoisting 'buf.address' out of the
loop and seeing if that has an effect.

Tom