Imagemagick not using enough memory

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
thelizardreborn
Posts: 1
Joined: 2012-05-21T15:39:55-07:00
Authentication code: 13

Imagemagick not using enough memory

Post by thelizardreborn »

I've found lots of posts about limiting Imagemagick's memory consumption. My problem is the opposite - our server is processing a large batch of images, and it appears as though "convert" is using no memory, and the excess of disk usage is causing the server to grind to a halt.

Relevant information
My command:

Code: Select all

nice convert -limit map 512mb -limit memory 512mb  -size 1000x1000 -quality 85 -flatten -scale 1000x1000 '/opt/lightbox/appfiles/thumbs/thm9c0qIj/fullkhzbBJ.jpg[1000x1000]'  '/opt/lightbox/appfiles/thumbs/thm9c0qIj/usrqGlJJI.jpg'
ImageMagick info:

Code: Select all

convert -version
Version: ImageMagick 6.7.6-9 2012-05-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:
top output:

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 2223 apache    39  15 36208 2988 2180 R 97.0  0.0   0:03.11 convert
This is running on CentOS Linux, being run by PHP through the command line.

There are no active policies in policy.xml.

To be clear, I have looked at the documentation I could find about -limit, and I think the setting we have is good. I would like convert to use up to 512mb of memory, but for some reason it seems to be behaving as though the memory limit is 0.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Imagemagick not using enough memory

Post by magick »

For large images, ImageMagick will likely create a pixel cache on disk. To verify, add -debug cache to your command line. It tells you how much resource is required for a particular image and whether the resource is allocated to memory, memory-map, or disk. See http://www.imagemagick.org/script/architecture.php for additional details.
Post Reply