On Dec 15, 2009, at 12:30 PM, Wellenreuther, Gerd wrote: > Hi Perry, > > to clarify what I am doing - maybe the error lies in here: > > * First I am building up a list of the corrected+rotated images > > * After that is done I am creating the figure > > * Then looping over every image, creating proper axes for each > individual image and finally: > >> pylab.imshow(rotated_images[i],aspect='auto') >> rotated_images[i]=[] >> gc.collect(2) > > So I am trying to immediately delete the now obsolete image-data, by > removing the reference and forcing garbage collection. No idea whether > this is the proper/best way to do it ... but at least I hope my > intention is clear :). > > Anyone an idea how to improve?
if the above code is in a loop, and there is no figure clearing in the loop, then rotated_images[i] = [] gc.collect(2) will have no effect since matplotlib will still have references to the array (and generally, you never need to call gc.collect by the way). What isn't clear to me in this is how you handle the offsetting and combining of images. Normally imshow will just display one image right over the other. Can you just insert the appropriate subsampled image into one output image, and then display that. After the insertion, you can delete the input image inside the loop. Perry ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users