You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Imported. Original comment by [email protected] on August 30, 2011, 09:54:50 PM UTC)
It seems to me that there are two potential issues here:
It seems likely that resources allocated for the ImageSurfaces being created are not being freed properly. Do we need to call finishSurface after we are done? I don't yet understand exactly how the cairo API is supposed to be used here.
Another potential problem is that we lose sharing when doing (replicate 500 $ image "foo"), leading to 500 ImageSurfaces being created and destroyed. In this particular case it would be better if we just created a single ImageSurface and then used it repeatedly. A simple way to achieve this would be with a Map from image file names to surfaces. Intuitively it seems like this would be a win; most diagrams using a lot of image primitives will probably have a lot of repeated ones.
However, I understand this was NOT the case for the original diagram which precipitated this bug report! For such diagrams the Map would incur the extra overhead of looking up each new file name in the Map before creating a surface. I guess some profiling is needed to figure out the best general policy.
(Imported. Original comment by [email protected] on November 16, 2011, 12:50:37 PM UTC)
Perhaps it is. "cat" seemed to make a small difference, but the example still eats the memory and I'm inclined to think that finishSurface or some other resource freeing call is needed here.
(Imported from http://code.google.com/p/diagrams/issues/detail?id=42. Original issue from [email protected] on August 30, 2011, 02:41:43 PM UTC)
What steps will reproduce the problem?
Should result in a long wait and foo.pdf with plenty of images. Instead gobbles up all memory in the system.
What version of the product are you using? On what operating system?*
The text was updated successfully, but these errors were encountered: