[magick-users] disk caching
James Whitwell
jams at momento.com.au
Mon Oct 29 16:24:06 PDT 2007
arcanaimperii at imagemagick.org wrote:
>> We've noticed that with large images that ImageMagick transparently
>> caches them on disk. Is there any way to disable this behaviour?
>>
>
> You can increase your memory limit like so:
>
> convert -limit memory unlimited ...
>
Great! Can anyone tell me, is this the equivalent C call?
SetMagickResourceLimit (MemoryResource, 4294967295);
I got this via tracing via the debugger.
> However, ImageMagick may still write to the pixel cache on disk if your system
> refuses to honor a memory request. You can limit the size of the pixel cache
> on disk with the disk limit option:
>
> convert -limit memory unlimited -limit disk 0 ...
>
> Here ImageMagick throws an exception if the image pixels are cached to disk.
>
So I'd call SetMagickResourceLimit (DiskResource, 0) for this I guess.
Does anyone know which exception would be thrown for this, in case I
want to handle it separately from my normal error handling? If I then
called SetMagickResourceLimit (DiskResource, ...) with a non-zero number
and tried again, that'd let me try again, wouldn't it?
> Last option is to use the Q8 version of ImageMagick rather than Q16. Q8
> uses less memory than Q16
Yep, we're already on Q8.
Thanks,
James.
More information about the Magick-users
mailing list