Re: Slow down - memory resource increase

"Stefan v. Wachter" <[email protected]> Fri, 08 Apr 2005 13:14:07 +0200
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
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
> [email protected], 
> http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>
>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click