cache exhausted

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

cache exhausted

Post 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"/>
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: cache exhausted

Post 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".
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: cache exhausted

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: cache exhausted

Post by snibgo »

Re patches: thanks, yes, I keep forgetting.
snibgo's IM pages: im.snibgo.com
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: cache exhausted

Post 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?
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: cache exhausted

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: cache exhausted

Post 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".
snibgo's IM pages: im.snibgo.com
Post Reply