Re: [GM-apis] Slow down - memory resource increase
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Stefan v. W. <svw...@mn...> - 2005-04-08 11:14:15
|
Again I want to point out that there is sometimes a difference between the resource memory amount managed by resource.c and the actually used heap memory of the GraphicsMagick process. In my case the resource memory constantly grew until it reached the memory limit. Then it switched to disk cache causing the slow down. Meanwhile the heap memory was almost constant! (I fixed the memory leak and the [MVG] issue.) Finally I found two sources of my problems with the increasing resource memory: First - in cache.c OpenCache the size for the pixel buffer (the offset var) is computed twice in different ways. In the case of a DirectClass image the results differ and generate a difference between the resource management and the actually occypied heap memory. Second - the DrawRender function changes the storage_class (sometimes?) from PseudoClass to DirectClass. I didn't investigate this further because at the moment it seemed sufficient for me to fix cache.c . Stefan Bob Friesenhahn wrote: > Stefan, > > I updated GraphicsMagick CVS with some improvements to string handling > performance. I was able to do more with the 1.2 development code-base > than with 1.1. For the 1.2 code-base, I was able to change how > attributes were stored. This allows your sample program to run in > almost constant time (but with increasing memory) even if the "[MVG]" > image attribute is not deleted each time around. > > Timings without deleting "[MVG]" attribute: > > loop: 1; nTicksPer10Frames 406 > . > . > . > loop: 999; nTicksPer10Frames 453 > > Due to my changes, I expect that drawing in general will be faster. > > For your application, I still recommend deleting the "[MVG]" > attribute. Be sure to fix the memory leak in your test code as well. > > Bob > ====================================== > Bob Friesenhahn > bfr...@si..., > http://www.simplesystems.org/users/bfriesen/ > GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ > > |