It seems like Azathoth was right about the garmage collector not cleaning up fast enough. I added a GCCollect call right after re-loading the images and it brings the memory usage right down to the same each time.
I usually use superstrict, but left it out for this quick example. Adding it did not bring up any errors, so I think that the code is alright. I has just forgotten, that garbage collection could be called upon manually, but figured that the automated way was good enough.
Thanks for the help guys.
I usually use superstrict, but left it out for this quick example. Adding it did not bring up any errors, so I think that the code is alright. I has just forgotten, that garbage collection could be called upon manually, but figured that the automated way was good enough.
Thanks for the help guys.