Page 1 of 1

Cache resources exhausted

Posted: 2020-02-11T05:11:42-07:00
by jmspaggi
Hi,

Seems that I'm facing a similar issue as this thread.

Code: Select all

(base) jmspaggi@precision5530:/media/jmspaggi/Puzzle$ convert +append input_black_01.tif input_black_02.tif input_black.tif
convert-im6.q16: cache resources exhausted `input_black_01.tif' @ error/cache.c/OpenPixelCache/4083.

Code: Select all

(base) jmspaggi@precision5530:/media/jmspaggi/Puzzle$ identify -list resource
Resource limits:
  Width: 16KP
  Height: 16KP
  List length: 18.446744EP
  Area: 128MP
  Memory: 256MiB
  Map: 512MiB
  Disk: 1GiB
  File: 768
  Thread: 12
  Throttle: 0
  Time: unlimited
I have 11GB of free storage space and 22GB of free memory. Input files are about 80MB each. I tried to play with the -limit parameter without any success.

Code: Select all

(base) jmspaggi@precision5530:/media/jmspaggi/WESTY/Puzzle$ convert -version
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib
Seems that limit with "20gb" returns very quickly but limit with "20GB" seems to run longer but still fails. Playing more with the parameter, 1m gives one byte. 1M gives 1 meg. 1g gives one byte. 1G gives 256 megs. It seems that it can not be increased above 256 megs.The same way it seems that it's not possible to increase the disk above 1G.

Any idea what is going wrong?

Thanks.

Re: Cache resources exhausted

Posted: 2020-02-11T05:20:11-07:00
by magick
Increase your Disk policy limit. Its currently 1GiB. Your command creates a pixel cache on disk that exceeds this limit and due to the policy restriction throws an exception.

Re: Cache resources exhausted

Posted: 2020-02-11T05:43:36-07:00
by jmspaggi
I'm not able. What ever number I put it limits it to 1GB:(

I can decrease the limit, I can not increase it.

I tried -limit 20G, says 1GB. If I say limit 1B, then it says one byte. anything under 1GB works, abythit above 1GB says 1GB. I'm probably doing something wrong.

Re: Cache resources exhausted

Posted: 2020-02-11T07:09:29-07:00
by jmspaggi
Here is an illustration of what I'm saying above.

Code: Select all

(base) jmspaggi@precision5530:/media/jmspaggi/Puzzle$ identify -limit memory 200MiB -list resource
Resource limits:
  Width: 16KP
  Height: 16KP
  List length: 18.446744EP
  Area: 128MP
  Memory: 200MiB
  Map: 512MiB
  Disk: 1GiB
  File: 768
  Thread: 12
  Throttle: 0
  Time: unlimited
(base) jmspaggi@precision5530:/media/jmspaggi/Puzzle$ identify -limit memory 300MiB -list resource
Resource limits:
  Width: 16KP
  Height: 16KP
  List length: 18.446744EP
  Area: 128MP
  Memory: 256MiB
  Map: 512MiB
  Disk: 1GiB
  File: 768
  Thread: 12
  Throttle: 0
  Time: unlimited
Give that I have 32GB of memory, with 22GB free, I was hoping to get something like this working:

Code: Select all

identify -limit memory 20480MiB -list resource
But this also gives only 256MiB of memory for the cache :(

Re: Cache resources exhausted

Posted: 2020-02-11T07:14:21-07:00
by snibgo
jmspaggi wrote:I can decrease the limit, I can not increase it.
I suppose you did this with "-limit" options on the command line. Yes, these are only more restrictive. You need to change the limits in policy.xml.

Re: Cache resources exhausted

Posted: 2020-02-11T07:16:11-07:00
by jmspaggi
Ha!!!!

Updating /etc/ImageMagick-6/policy.xml gives me what I want. Limits in the policy.xml file are maximum. So the 256MiB defined there by default is a maximum. Using the -limit command allows you to reduce this maximum, in case you are running low on memory or other. But you can't increase it.

This post has pointed me to the right direction.

(Just seeing snibgo post now. Thanks. I just ran my convert command successfully!)