-limit memory: no RAM used

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
darwinjob
Posts: 7
Joined: 2013-12-05T13:31:15-07:00
Authentication code: 6789

-limit memory: no RAM used

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: -limit memory: no RAM used

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -limit memory: no RAM used

Post 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.
snibgo's IM pages: im.snibgo.com
darwinjob
Posts: 7
Joined: 2013-12-05T13:31:15-07:00
Authentication code: 6789

Re: -limit memory: no RAM used

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -limit memory: no RAM used

Post 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
snibgo's IM pages: im.snibgo.com
Post Reply