Am Montag, 23. April 2007 20:23 schrieb chromatic:
> On Thursday 05 April 2007 16:56, Mehmet Yavuz Selim Soyturk wrote:
> > The next program causes a memory leak for me.
> >
> > .sub main :main
> > loop:
> > $P0 = new .String
> > goto loop
> > .end
That's an endless loop. How does one measure, if it's leaking memory?
Anway:
> I can't explain that, but here's some suspicious code in
> Parrot_allocate_string() in src/resources.c:
[ ... ]
> If I identify and read the related freeing code correctly
> (Parrot_dod_sweep() in src/gc/dod.c):
>
> else if (PObj_sysmem_TEST(b) && PObj_bufstart(b)) {
These 2 snippets aren't related at all. The latter is dealing with freeing
sys-malloced memory as the comment is saying. The former is plain string
memory allocation code.
I'd presume, that the string memory compaction code i.e. 'compact_pool()' is
never run in the loop above.
leo