What to do if "convert" or "identify" is using too much RAM
Background
Sometimes ImageMagick can cause servers to run very slowly because it uses huge amounts of RAM for some files. You can use environment variables to limit the amount of RAM that ImageMagick will use.
The main ImageMagick commands that Asset Bank uses are "convert" and "identify" so these are the process names to look out for in "top" (and other system monitoring utilities).
How to Implement
To see the default resource limits that ImageMagick will use on your server, run "convert -list resource". Decide how much to allocate to ImageMagick's pixel cache - this should be sized so that it fits comfortably in the server's physical RAM. In this example we will use 1GB which is often appropriate.
Edit the Tomcat environment variable script (<tomcat home>/bin/setenv.sh if you have installed Tomcat without using a package manager, /etc/default/tomcat5.5 on Debian Linux) and add the following lines:
# Limit the amount of RAM used by ImageMagick subprocesses
export MAGICK_AREA_LIMIT=1024mb
Then restart tomcat:
/etc/init.d/tomcat5.5 restart
More Information
More information about tuning ImageMagick's memory usage is available here and here on the ImageMagick web site.
Comments
0 comments
Please sign in to leave a comment.