Page 1 of 1

cache exhausted

Posted: 2019-08-05T12:30:51-07:00
by dognose
After an upgrade, I'm running into policy trouble.
I don't understand what's going wrong..
Any idea?

Code: Select all

# convert --version
Version: ImageMagick 6.7.8-9 2019-02-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

# identify test.jpg
test.jpg JPEG 1000x450 1000x450+0+0 8-bit DirectClass 68.1KB 0.000u 0:00.000

# convert -debug cache test.jpg test.png
2019-08-05T15:22:54-04:00 0:00.000 0.000u 6.7.8 Cache convert[15142]: cache.c/DestroyPixelCache/1448/Cache
  destroy
2019-08-05T15:22:54-04:00 0:00.000 0.000u 6.7.8 Cache convert[15142]: cache.c/DestroyPixelCache/1448/Cache
  destroy test.png[0]
convert: cache resources exhausted `test.jpg' @ error/cache.c/OpenPixelCache/4080.
convert: Application transferred too few scanlines `test.jpg' @ warning/jpeg.c/JPEGErrorHandler/313.
convert: cache resources exhausted `test.png' @ error/cache.c/OpenPixelCache/4080.
convert: memory allocation failed `test.png' @ error/png.c/WriteOnePNGImage/8440.


# convert -list resource
File         Area       Memory          Map         Disk    Thread         Time
-------------------------------------------------------------------------------
 768           1B    3.7253GiB         4GiB          16B         8           60

limits are as follows
  <policy domain="resource" name="temporary-path" value="/tmp"/>
  <policy domain="resource" name="memory" value="4GB"/>
  <policy domain="resource" name="map" value="4GiB"/>
  <policy domain="resource" name="area" value="1gb"/>
  <policy domain="resource" name="width" value="10MP"/>
  <policy domain="resource" name="height" value="10MP"/>
  <policy domain="resource" name="disk" value="16eb"/>
  <policy domain="resource" name="thread" value="8"/>

Re: cache exhausted

Posted: 2019-08-05T12:39:38-07:00
by snibgo
You upgraded to 6.7.8-9? I suggest a more recent version.

Your "list resource" seems to show the Area is limited to 1B (one byte), and Disk to 16B (sixteen bytes). Perhaps the entries in policy.xml are being misread. Try changing "gb" to "GiB".

Re: cache exhausted

Posted: 2019-08-05T13:01:33-07:00
by fmw42
snibgo, on Linux, they patch without changing the version number. So the date of the patch is more important, i.e. 2019-02-01 (Jan 2019). Perhaps there is a more current patch. Nevertheless, it seems that they do not always do such a good job of patching and often just patch only for security issues.

Re: cache exhausted

Posted: 2019-08-05T13:40:01-07:00
by snibgo
Re patches: thanks, yes, I keep forgetting.

Re: cache exhausted

Posted: 2019-08-06T06:10:44-07:00
by dognose
Just using the stock version that came with the latest centos. .

I guess you changed the formatting of memory listings? I don't understand why GiB?

Re: cache exhausted

Posted: 2019-08-06T06:32:05-07:00
by dognose
I'll add that I did try to upgrade to latest version, but there is no easy way without compiling from source and assembling together all delegates and stuff. (I've had much worse luck with that in the past)
I see a number of unanswered messages here how to install from rpm

Re: cache exhausted

Posted: 2019-08-06T08:02:36-07:00
by snibgo
dognose wrote:I guess you changed the formatting of memory listings? I don't understand why GiB?
Your (patched) IM is reading "1gb" and reporting that as "1B". This will force pixel caches to disk. But your disk limit is set to "16eb", which IM is reporting as "16B", so there is insufficient room on disk for the caches.

We can see that IM is correctly reading "4GB" and "4GiB". So I suggest you edit your policy.xml settings for "area" and "disk".