[PD] Re: [GEM] pix_resize eating RAM

Davide Morelli info at davidemorelli.it
Thu Jun 16 18:56:00 CEST 2005



the bug I reported was relative to GEM 0.90 on win.

I just compiled pix_resize from cvs and the problem seems fixed
so don't waste time on this...

I was looking at 0.90 sources when I told you to try freeing resizedData 
(allocated at line 63)
but in the CVS version there is not such allocation..

next time I'll look at the CVS before reporting about bugs...


----- Original Message ----- 
From: "IOhannes m zmoelnig" <zmoelnig at iem.at>
To: "Parser - Davide Morelli" <davide.morelli at parser.it>
Cc: "PD list" <pd-list at iem.at>
Sent: Wednesday, June 15, 2005 10:51 AM
Subject: [PD] Re: [GEM] pix_resize eating RAM


> yes, i can reproduce the problem, although i am not really sure where it 
> happens: i would like to blame gluScaleImage(), although i cannot really 
> imagine this. (but commenting it out seems to fix the memory leak)
>
> hmm, i'll have to make some further tests
> probably writing the resizing function ourselves would be a good idea 
> anyhow (gluScaleImage() seems to be rather slow)
>
>
> Parser - Davide Morelli wrote:
>> Hi list,
>>
>> I am trying to resize a live video feed to a very small picture (16x12),
>> extract a list of rgba values from this image and pass the list to 
>> ann_mlp.
>>
>> On my system the pix_resize object keeps eating RAM over and over every 
>> time
>> I pass it a pix. (see the attached patch)
>>
>> Maybe either the unsigned char * resizedData or the old image.data should 
>> be
>> freed somewhere?
>
> freeing and allocation are handled by reallocate(), so this should be 
> fine.
> and the memory is leaking rather slow (but noticable) on my machine. if 
> the resizedData would be allocated (but not free) each and every frame, i 
> would have noticed the leak long before....
>
>>
>> WinXP
>> GEM 0.90 (compiled Aug 3 2004)
>> Pd 0.38-3
>>
>> Btw: in a old post
>> (http://lists.puredata.info/pipermail/pd-list/2005-04/027626.html) I've 
>> read
>> that pix_resize can be used with 2 args:
>> [pix_resize X Y] to get an image Y height and X width
>> But in the example patch attached it doesn't seem to work, and looking at
>> the source code (pix_resize.cpp) I don't see how pix_resize could do 
>> that.
>> ... Is there a way to reduce an image size?
>> E.g. from 320x240 to 16x12 pixels?
>
> you would have to compile the CVS version yourself for w32.
>
> mfg.ads.r
> IOhannes
>
>>
>> Thank you,
>> Davide.
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list
> 





More information about the Pd-list mailing list