Page 1 of 1

convert ignores memory limit set in policy.xml

Posted: 2011-08-20T11:31:29-07:00
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

Re: convert ignores memory limit set in policy.xml

Posted: 2011-08-20T14:47:58-07:00
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.

Re: convert ignores memory limit set in policy.xml

Posted: 2011-08-20T15:31:37-07:00
by nickvalo
Thanks for such a quick investigation and turnaround!

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

Thanks again!