convert or mogrify failing with resource exhaustion
Posted: 2018-02-02T09:54:27-07:00
How can I get convert or mogrify to tell me WHICH resource is getting exhausted?
I'm trying to convert large multi page color PDF's (8Mb 20-30 page docs) to monochrome and nothing I have tried has gotten me past the resource exhaustion.
I'm using a pretty powerful machine running Ubuntu 17.10 with ~50GB free and 16GB of ram. I've gone in to policy.xml and increased limits on every enabled policy (I even turned the file policy on) and still get the failures.
I've tried running the command with command line switches to increase limits and still get failures. Why doesn't the error message plainly spell out which one is causing it, or is it doing so in a way that I don't understand?
Here is the command I am running.
Here is sample output with verbose turned on:
I'm trying to convert large multi page color PDF's (8Mb 20-30 page docs) to monochrome and nothing I have tried has gotten me past the resource exhaustion.
I'm using a pretty powerful machine running Ubuntu 17.10 with ~50GB free and 16GB of ram. I've gone in to policy.xml and increased limits on every enabled policy (I even turned the file policy on) and still get the failures.
Code: Select all
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<policy domain="resource" name="memory" value="3GiB"/>
<policy domain="resource" name="map" value="3GiB"/>
<policy domain="resource" name="width" value="24KP"/>
<policy domain="resource" name="height" value="24KP"/>
<policy domain="resource" name="area" value="1024MB"/>
<policy domain="resource" name="disk" value="10GiB"/>
<policy domain="resource" name="file" value="1536"/>
Here is the command I am running.
Code: Select all
find . -iname '*.pdf' -print0|xargs -0 -L 1 mogrify -density 1200 -threshold 70% -resample 100 -limit file 2000 -limit disk 4GiB -verbose
Code: Select all
'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r1200x1200' '-sOutputFile=/tmp/magick-25241wrDLmeuXFXZu%d' '-f/tmp/magick-25241PcpVgIkhhAHw' '-f/tmp/magick-25241gZIZwEpcUipy'
/tmp/magick-25241wrDLmeuXFXZu1 PNG 10200x13200 10200x13200+0+0 8-bit sRGB 1.796MB 2.230u 0:02.230
/tmp/magick-25241wrDLmeuXFXZu2 PNG 10200x13200 10200x13200+0+0 8-bit sRGB 1.522MB 2.570u 0:02.560
/tmp/magick-25241wrDLmeuXFXZu3 PNG 10200x13200 10200x13200+0+0 8-bit sRGB 1.515MB 2.700u 0:02.709
./CP 2017/S/TEST_12-28-17-100153266.pdf[0] PDF 10200x13200 10200x13200+0+0 16-bit sRGB 1.796MB 5.280u 0:05.269
./CP 2017/S/TEST_12-28-17-100153266.pdf[1] PDF 10200x13200 10200x13200+0+0 16-bit sRGB 1.796MB 2.710u 0:02.709
./CP 2017/S/TEST_12-28-17-100153266.pdf[2] PDF 10200x13200 10200x13200+0+0 16-bit sRGB 1.796MB 0.010u 0:00.000
./CP 2017/S/TEST12-28-17-100153266.pdf[0] PDF 10200x13200=>850x1100 850x1100+0+0 16-bit GrayscaleAlpha Gray 354KB 26.190u 0:10.469
mogrify-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
mogrify-im6.q16: cache resources exhausted `/tmp/magick-25241wrDLmeuXFXZu4' @ error/cache.c/OpenPixelCache/3982.