in reply to Re: how to free memory allocated for Tk::Photo?
in thread how to free memory allocated for Tk::Photo?
Very interesting, tested, and -shrink does give memory back. I would rather think that is a bug with read(), not a feature.
If the memory usage only goes up to fit the largest picture, it makes sense to me, as shrink is not specified, so the memory was retained. I would even think it as a feature, as that might increase efficiency, sort of like maintaining a water mark.
However it is buggy if the memory goes up every time you read() a new photo without -shrink, regardless whether it is bigger than the biggest.
At least they should document it as a caveat that, "without -shrink, read() will cause significant memory leak" ;-)
|
|---|