Hi,
Cairo keeps on telling me that I am out of memory on ordinary examples. Does anyone know the explanation of this ? Can I safely ignore ? Regards, @+Maarten, _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
It depends on what API you're using to control the cairo surface and
contexts. The objects will garbage collect as weak references when they are no longer being referenced and this in turn decrements Cairo's reference counting garbage collector for the object. The problem often is, that if you do lots of drawing very quickly, you can run out of handles in cairo before VW has freed them. To get around this, Travis added APIs that release the objects at the end of a block call, eg: surface newCairoContextWhile: [:cr | ... ] instead of: surface context and: graphicsContext newCairoContextWhile: [:cr | ... ] instead of: graphicsContext cairoContext and: window newCairoSurfaceWhile: [:surface | ... ] instead of: pixmap cairoSurface etc. There are other ways you can get this problem, but we found those to be the main ones. Your mileage may vary :) Michael Maarten Mostert wrote: > Hi, > > Cairo keeps on telling me that I am out of memory on ordinary examples. > > Does anyone know the explanation of this ? > > Can I safely ignore ? > > Regards, > > @+Maarten, > > > ------------------------------------------------------------------------ > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert-2
Maarten,
Can you share what display platform you're using? And possibly what version of Cairo (LibCairo libraryVersion)? On some of the display platforms, the OoM (Out of Memory) is overloaded, which means, it doesn't always mean OoM. :) I'd be curious what you were doing that was getting that error. TIA -- Travis Griggs Objologist Time and Countertops. They both get used up way too fast. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Hi Travis,
I spoiled a glass of excellent french wine over my macbook ( which was to bad for the wine and the keyboard) so I am on an old french WinXP home machine on which I installed GTK 2.19. I noticed quite bad performance on this kind of hardware when I tried to draw to a larger screen 2000*2000 with some gradients. As I am used to scroll over the entire range of the original gc , I now first try to build some fake scrollable view to overcome this. The tip Michael gave me this morning seems to work well (at least for the moment). Regards, @+Maarten, Travis Griggs a écrit : > Maarten, > > Can you share what display platform you're using? And possibly what > version of Cairo (LibCairo libraryVersion)? > > On some of the display platforms, the OoM (Out of Memory) is > overloaded, which means, it doesn't always mean OoM. :) I'd be curious > what you were doing that was getting that error. > > TIA > > -- > Travis Griggs > Objologist > Time and Countertops. They both get used up way too fast. > > > > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Michael Lucas-Smith-2
Hi Michael,
Well this works a lot better as said earlier, however it gives for horrible debugging with the gc inside a block ! I redirected the Error to Transcript and my image does not seems to bother about it so much. Regards, @+maarten, Michael Lucas-Smith a écrit : > It depends on what API you're using to control the cairo surface and > contexts. > > The objects will garbage collect as weak references when they are no > longer being referenced and this in turn decrements Cairo's reference > counting garbage collector for the object. > > The problem often is, that if you do lots of drawing very quickly, you > can run out of handles in cairo before VW has freed them. > > To get around this, Travis added APIs that release the objects at the > end of a block call, eg: > > surface newCairoContextWhile: [:cr | ... ] > instead of: > surface context > > and: > > graphicsContext newCairoContextWhile: [:cr | ... ] > instead of: > graphicsContext cairoContext > > and: > > window newCairoSurfaceWhile: [:surface | ... ] > instead of: > pixmap cairoSurface > > etc. > > There are other ways you can get this problem, but we found those to > be the main ones. > > Your mileage may vary :) > > Michael > > Maarten Mostert wrote: >> Hi, >> >> Cairo keeps on telling me that I am out of memory on ordinary examples. >> >> Does anyone know the explanation of this ? >> >> Can I safely ignore ? >> >> Regards, >> >> @+Maarten, >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> vwnc mailing list >> [hidden email] >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc >> > > > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert-2
Maarten Mostert wrote:
> Hi Travis, > > I spoiled a glass of excellent french wine over my macbook ( which was > to bad for the wine and the keyboard) so I am on an old french WinXP > home machine on which I installed GTK 2.19. > I noticed quite bad performance on this kind of hardware when I tried to > draw to a larger screen 2000*2000 with some gradients. As I am used to > scroll over the entire range of the original gc , I now first try to > build some fake scrollable view to overcome this. > > The tip Michael gave me this morning seems to work well (at least for > the moment). > > GPU.. and I think that's doubly-so on Windows. So you've still got the same hardware bandwidth issue as Bitblt - in that a 2000*2000*24 is 96mbs of data every time you draw and if you try to do that too often, you really will hit the limit of the motherboard :) I've seen talk on the cairo irc channel about optimizing the windows backend to use hardware like they do on MacOSX (at least, I think they do on MacOSX). The only other way to go from here for -speed- is to use a 3d library like DirectX or OpenGL. Or, get a lot smarter about how and when you draw things :) Cheers, Michael > Regards, > > @+Maarten, > > Travis Griggs a écrit : > >> Maarten, >> >> Can you share what display platform you're using? And possibly what >> version of Cairo (LibCairo libraryVersion)? >> >> On some of the display platforms, the OoM (Out of Memory) is >> overloaded, which means, it doesn't always mean OoM. :) I'd be curious >> what you were doing that was getting that error. >> >> TIA >> >> -- >> Travis Griggs >> Objologist >> Time and Countertops. They both get used up way too fast. >> >> >> >> >> > > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |