convert ignores memory limit set in policy.xml

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
nickvalo
Posts: 2
Joined: 2011-08-20T11:20:39-07:00
Authentication code: 8675308

convert ignores memory limit set in policy.xml

Post by nickvalo »

The following convert command takes more than 7GB of memory to run, which is causing out of memory conditions on our Linux server. I understand that the resource limits are for the pixel cache. Does this command use something other than the pixel cache? If so, can we set "non-pixel cache" memory limits? Any ideas why it would consume so much memory and ways to limit it are very welcome!

convert -type TrueColorMatte -background none -fill #000000 -font /var/www/resource/_fonts/BALLW___.TTF -gravity center -size 720x label:1 /var/tmp/_img/temp/2011tmp2.png

Here is where the memory consumption is shown ... under RSS (7.2GB). It's taking 43.8% of our 16GB RAM server ... and growing, until the server crashes with an out of memory condition.
  • USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    apache 28483 99.3 43.8 7275728 7212156 ? R 13:54 0:17 convert -type TrueColorMatte -background none -fill #000000 -font /var/www/resource/_fonts/BALLW___.TTF -gravity center -size 720x label:1 /var/tmp/_img/temp/2011tmp2.png
Here is our resource limit settings.
identify -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
500 128MB 244.1MiB 488.3MiB 488.3MiB 1 60
... and version ...
identify -version
Version: ImageMagick 6.7.1-0 2011-07-14 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert ignores memory limit set in policy.xml

Post by magick »

We can reproduce the problem you reported and have a patch in ImageMagick 6.7.1-9 Betsa available by sometime tomorrow. Thanks.
nickvalo
Posts: 2
Joined: 2011-08-20T11:20:39-07:00
Authentication code: 8675308

Re: convert ignores memory limit set in policy.xml

Post by nickvalo »

Thanks for such a quick investigation and turnaround!

Just out of curiosity, what part of the command triggered the problem?

Thanks again!
Post Reply