lettier / gifcurry

😎 The open-source, Haskell-built video editor for GIF makers.
https://lettier.github.io/gifcurry
BSD 3-Clause "New" or "Revised" License
1.36k stars 56 forks source link

"cache resources exhausted" Error #48

Closed peterstory closed 5 years ago

peterstory commented 5 years ago

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.
lettier commented 5 years ago

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.

:+1:

peterstory commented 5 years ago

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"/> -->
Forage commented 3 years ago

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"/>