Eric Wasylishen wrote:
Hi Riccardo,
As a starting point for debugging I would put NSLog's in
XGCairoModernSurface -initWithDevice: and -dealloc. This is where we
retain / release the Cairo surface that is holding memory in the x server.
Also I would put logging in -NSImage set name:, log [nameDict allKeys]
to see which images are kept in memory by nameDict.
In between those two points, NSImage has a NSCachedImageRep which has
a GSCacheW (NSWindow subclass). NSWindow retains the Cairo surface
though I don't remember exactly how.
Note that if you keep loading different images, we currently have no
facility for releasing old NSImages from nameDict, so once an image is
cached we never release it. This should be a fairly easy thing to fix
by turning it in to a proper cache with some eviction policy and size
estimation per NSImage.
But anyway, if you switch back and forth between two images it
shouldn't leak, so there is a bug somewhere.
Well, I don't switch back and forth between two images, but am viewing a
film roll, so e.g. 36 images. So if they all remain cached, this can
explain the increase.
If they are cached however,t hen perhaps they should load faster thnan
they do.
Are you implying that if we just continue to load images we throw them
into the server without never releasing until we quit an application?
For an application that runs long that ould mean eating up a lot of ram,
even with many small images!
Riccardo
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep