[plt-scheme] memory leak (program attached)
> At Sat, 15 Nov 2008 16:32:22 +0000, Vladimir Konrad wrote:
> > > I am trying to trace memory leak in program, which loads images
> > > and samples the pixels (the file attached works but leaks memory).
> If that's correct, you'd also get better results by adding `(send
> bitmap-dc set-bitmap #f)' after the bitmap is used.
The "set-bitmap #f" does the trick, the memory usage stays constant
while reading ~1000 of images.
This is great and I do not have to re-write the program to use the
bitmap% object directly :-).
> There's a check in the system that triggers extra major collections
> when the number of bitmaps grows (because bitmaps and finalization
> interact badly in many ways). So, the system will eventually reach a
> steady state for your program --- but at much higher memory use than
> if the link is broken explicitly.
Thank you very much for your help and explanations.
Vlad