Cache resource exhausted with specific image

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?".
Locked
Julissa
Posts: 3
Joined: 2020-03-05T12:44:31-07:00
Authentication code: 1152

Cache resource exhausted with specific image

Post by Julissa »

Hello! I'm facing a similar issue to this and this.

On convert I get the following error:

Code: Select all

`convert '/tmp/5fd79ef53c3bc5dfbf00cdfad270902e20200305-13805-1nw7gww.png[0]' -auto-orient -strip '/tmp/2fc8592785e05dadc8f224bada29defc20200305-13805-1ao6jel'`
convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `/tmp/2fc8592785e05dadc8f224bada29defc20200305-13805-1ao6jel' @ error/cache.c/OpenPixelCache/3984.
convert-im6.q16: No IDATs written into file `/tmp/2fc8592785e05dadc8f224bada29defc20200305-13805-1ao6jel' @ error/png.c/MagickPNGErrorHandler/1628.


I've tried updating the limits in the policy.xml file and have even commented them out so I could get the max usage.

Code: Select all

Resource limits:
  Width: 214.7MP
  Height: 214.7MP
  Area: 16.515GP
  Memory: 7.6905GiB
  Map: 15.381GiB
  Disk: unlimited
  File: 768
  Thread: 2
  Throttle: 0
  Time: unlimited

Code: Select all

Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
The image itself is a 5872 × 2779 png.

Any thoughts on what could be going on?

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cache resource exhausted with specific image

Post by snibgo »

You don't give a format for your output file, by giving a extension such as ".png" or ".tiff". I suggest you should always give an extension.
snibgo's IM pages: im.snibgo.com

Julissa
Posts: 3
Joined: 2020-03-05T12:44:31-07:00
Authentication code: 1152

Re: Cache resource exhausted with specific image

Post by Julissa »

Thanks for the reply!

I added the file format (for context, I'm using the Paperclip gem in Rails). I'm still getting the error though.

Code: Select all

`convert '/tmp/5fd79ef53c3bc5dfbf00cdfad270902e20200306-15372-we69fs.png[0]' -auto-orient -strip '/tmp/a1add34a360dd608fecc4672373ffff820200306-15372-7dtyi6.png'`
convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `/tmp/a1add34a360dd608fecc4672373ffff820200306-15372-7dtyi6.png' @ error/cache.c/OpenPixelCache/3984.
convert-im6.q16: No IDATs written into file `/tmp/a1add34a360dd608fecc4672373ffff820200306-15372-7dtyi6.png' @ error/png.c/MagickPNGErrorHandler/1628.

Code: Select all

Resource limits:
  Width: 214.7MP
  Height: 214.7MP
  Area: 32.43GP
  Memory: 15.102GiB
  Map: 30.203GiB
  Disk: unlimited
  File: 768
  Thread: 8
  Throttle: 0
  Time: unlimited
edit:

Just wanted to clarify that when I added the jpg format it worked but not png. The original image is a png which is why I'd like to keep it in that format.

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cache resource exhausted with specific image

Post by fmw42 »

Perhaps you are running out of allow space in /tmp. Processing in /tmp is not recommended as it also holds the ImageMagick internally created temporary files. Do you have any large files left in /tmp that were not cleared, especially from ImageMagick? Clean them out.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cache resource exhausted with specific image

Post by snibgo »

I don't know what "the Paperclip gem in Rails" is. Perhaps it limits resources available to IM.
snibgo's IM pages: im.snibgo.com

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: Cache resource exhausted with specific image

Post by magick »

Try

Code: Select all

identify -list policy
if the policies look reasonable, try the command in your "Paperclip gem" environment. Its possible the environment is modifying the polices.

Julissa
Posts: 3
Joined: 2020-03-05T12:44:31-07:00
Authentication code: 1152

Re: Cache resource exhausted with specific image

Post by Julissa »

Looks like the issue is the environment in Paperclip. I get these results:

With Paperclip:

Code: Select all

Resource limits:
 Width: 214.7MP  
 Height: 214.7MP  
 Area: 50MP 
 Memory: 476.8MiB
 Map: 476.8MiB
 Disk: 238.4MiB
 File: 100
 Thread: 2
 Throttle: 0 
Time: unlimited
Without:

Code: Select all

Resource limits:
  Width: 214.7MP
  Height: 214.7MP
  Area: 16.515GP
  Memory: 7.6905GiB
  Map: 15.381GiB
  Disk: unlimited
  File: 768
  Thread: 2
  Throttle: 0
  Time: unlimited
Thank you for pointing me in the right direction! It definitely seems like policies are being overwritten. I will continue to dig into this as it seems like this isn't an ImageMagick issue anymore.

Locked