Page 1 of 1

-limit memory: no RAM used

Posted: 2013-12-11T12:17:24-07:00
by darwinjob
Hi
I have this command:
convert -verbose -define tiff:tile-geometry=256x256 -limit memory 12GB source.png -type TrueColor -compress lzw output.tif
If I run it it works very slow, it creates a huge temp file but no memory is used. Do I misunderstand "-limit memory" somehow?
The source file is 40000x40000, I have 16G RAM.

Re: -limit memory: no RAM used

Posted: 2013-12-11T12:27:37-07:00
by magick
Memory limits limit how much memory ImageMagick asks for from the OS to create an image pixel cache. That does not mean that the OS will grant the request. If the request fails for memory, ImageMagick instead creates the image pixel cache on disk which is upwards of three magnitudes slower than memory access.

Re: -limit memory: no RAM used

Posted: 2013-12-11T12:41:30-07:00
by snibgo
A simplistic calculation, at 6 bytes per pixels, times two (to store the input, and create the output) suggests that IM will ask for 19.2 GB of memory.

Re: -limit memory: no RAM used

Posted: 2013-12-11T14:14:38-07:00
by darwinjob
Does this mean that if IM asks for 12G but say only 8G is available it just ignores the available memory and does everything on disk?

Re: -limit memory: no RAM used

Posted: 2013-12-11T15:05:42-07:00
by snibgo
Sorry, I don't know. But I expect that each pixel cache is either in memory or on disk, not split between the two. I don't know how many caches are required in different circumstances. See http://www.imagemagick.org/script/archi ... .php#cache