lettier/gifcurry

"cache resources exhausted" Error

peterstory opened this issue · 3 comments

Hopefully you can help me resolve this "cache resources exhausted" error. Perhaps there is an option I can pass to imagemagick to increase the amount of cache available? Currently, I'm using gifcurry from the GUI, but using the CLI is no problem for me.

Thanks in advance!

[INFO] Here are your settings.

  - FILE IO:
    - Input File:    /home/peter/Downloads/My Video.mp4
    - Output File:   /home/peter/Downloads/mygif.gif
    - Save As Video: No
  - TIME:
    - Start Second: 0.000
    - End   Second: 32.000
  - OUTPUT FILE SIZE:
    - Width:       500px
    - FPS:         20
    - Color Count: 256
    - Dither:      False
  - CROP:
    - Left:   0.000
    - Right:  0.000
    - Top:    0.000
    - Bottom: 0.000

[INFO] Writing the temporary frames to: /home/peter/.cache/gifcurry/gifcurry-frames10700
[INFO] Saving your GIF to: /home/peter/Downloads/mygif.gif
convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `/home/peter/.cache/gifcurry/gifcurry-frames10700/extracted-frames_0000000377.png' @ error/cache.c/OpenPixelCache/3984.
...
convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `/home/peter/.cache/gifcurry/gifcurry-frames10700/extracted-frames_0000000440.png' @ error/cache.c/OpenPixelCache/3984.
convert-im6.q16: too many exceptions (exception processing suspended).
[ERROR] Something went wrong with ImageMagick.

Hello @peterstory,

Take a look at your resource limits for ImageMagick.

identify -list resource

You may want to tweak or just comment out the policy map in the ImageMagick policy.
The file is usually located at /etc/ImageMagick-6/policy.xml.

👍

Thanks @lettier, that fixed my problem!

--- /etc/ImageMagick-6/policy.xml.original	2019-10-24 08:43:39.686368941 -0400
+++ /etc/ImageMagick-6/policy.xml	2019-10-24 08:49:40.087009475 -0400
@@ -50,12 +50,12 @@
 -->
 <policymap>
   <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
-  <policy domain="resource" name="memory" value="256MiB"/>
-  <policy domain="resource" name="map" value="512MiB"/>
+  <!-- <policy domain="resource" name="memory" value="256MiB"/> -->
+  <!-- <policy domain="resource" name="map" value="512MiB"/> -->
   <policy domain="resource" name="width" value="16KP"/>
   <policy domain="resource" name="height" value="16KP"/>
-  <policy domain="resource" name="area" value="128MB"/>
-  <policy domain="resource" name="disk" value="1GiB"/>
+  <!-- <policy domain="resource" name="area" value="128MB"/> -->
+  <!-- <policy domain="resource" name="disk" value="1GiB"/> -->
   <!-- <policy domain="resource" name="file" value="768"/> -->
   <!-- <policy domain="resource" name="thread" value="4"/> -->
   <!-- <policy domain="resource" name="throttle" value="0"/> -->

I just ran into the same issue with the CLI version. Commenting out the following line was sufficient for me:

<policy domain="resource" name="memory" value="256MiB"/>