convert do not use enough memory
Posted: 2011-06-17T08:21:05-07:00
Description:
Imagemagick create a cache file in /tmp when there is not engough memory.
But it appears that it create it too soon, not using the avaible memory. In my case the convert command create a 300 Mb pixel cache memory in /tmp and use it but then consume only 5% of avaible memory and the pixel cache in /tmp. As my machine have enough memory this cause the kernel to cache the file in /tmp in RAM but that slow down convert a lot a use a lot of system time. Normally it should only create this file and use it when not having enough memory. Previous versions did not had this problem.
Details of the test.
convert -density 600x600 -monochrome -compress Group4 test.pnm test.pdf
where test.pnm is a 34 Mb pnm file in grayscale (600 dpi for an A4 page). My system has 1278672 Mb of memory (archlinux 32 bits).
The problem only appears for rather large files. It seems that in my case convert restrict itself to ~ 70 Mb of memory. Any file that need less than that will not have problems.
I am unsure if it is arch related of if it is an upstream bug. It did not appears with previous version of imagemagick (works correctly with 6.6.0-4)
ImageMagick 6.6.9-8
P.S. I have also submitted this bug to archlinux, I am not sure who is really in fault here (my distribution is archlinux current, kernel 2.6.39-ARCH)
Imagemagick create a cache file in /tmp when there is not engough memory.
But it appears that it create it too soon, not using the avaible memory. In my case the convert command create a 300 Mb pixel cache memory in /tmp and use it but then consume only 5% of avaible memory and the pixel cache in /tmp. As my machine have enough memory this cause the kernel to cache the file in /tmp in RAM but that slow down convert a lot a use a lot of system time. Normally it should only create this file and use it when not having enough memory. Previous versions did not had this problem.
Details of the test.
convert -density 600x600 -monochrome -compress Group4 test.pnm test.pdf
where test.pnm is a 34 Mb pnm file in grayscale (600 dpi for an A4 page). My system has 1278672 Mb of memory (archlinux 32 bits).
The problem only appears for rather large files. It seems that in my case convert restrict itself to ~ 70 Mb of memory. Any file that need less than that will not have problems.
I am unsure if it is arch related of if it is an upstream bug. It did not appears with previous version of imagemagick (works correctly with 6.6.0-4)
ImageMagick 6.6.9-8
P.S. I have also submitted this bug to archlinux, I am not sure who is really in fault here (my distribution is archlinux current, kernel 2.6.39-ARCH)