Distributed Pixel Cache Exception

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
ZT1987
Posts: 1
Joined: 2013-11-21T10:16:56-07:00
Authentication code: 6789

Distributed Pixel Cache Exception

Post by ZT1987 »

Hello everyone,

I'm a new user of ImageMagick, please try to help me with my issue. What could be the reason of getting an exception in a Java code using ImageMagick like this:

Caused by: org.im4java.core.CommandException: convert: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/210.
at org.im4java.core.ImageCommand.finished(ImageCommand.java:249)
at org.im4java.process.ProcessStarter.run(ProcessStarter.java:314)

I know what Distributed Pixel Cache is good for. I figured it out that there are 3 different scenarios which can cause this error by looking into the source code of distribute-cache.c

Code: Select all

  status=getaddrinfo(hostname,service,&hint,&result);  %status!=0

Code: Select all

   client_socket=socket(result->ai_family,result->ai_socktype,result->ai_protocol); %client_socket==-1

Code: Select all

   status=connect(client_socket,result->ai_addr,result->ai_addrlen); %status==-1
I'm just curious in what case do these parameters have the appropriate value to cause the appearnce of an error message? Wrong IP and not enough sockets is my guess in the first two, but what about the third one? And how is the default value of the IP defined, why is it 127.0.0.1 in our case? Is there any possibility to turn Distributed Pixel Cache off?

Thank you in advance!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Distributed Pixel Cache Exception

Post by magick »

ImageMagick tries to allocate the pixel cache in memory, then on disk that is memory mapped, then on disk, then with the distributed cache. Unless there is a bug somewhere, your temporary disk partition must be full such that ImageMagick can't allocate the pixel cache. To find out where ImageMagick is looking, try converting one of your images with the convert command but add the -debug cache to your command line. Post the output here so we can analyze it:
  • convert -debug cache myimage.jpg myimage.png
Does the pixel cache allocate on disk? If so where? Check the file path and verify there is plenty of free space on that disk partition.

Do you sent limits (e.g. MAGICK_MEMORY_LIMIT or -limit)? If so, type
  • convert -list resource
and post the output here for analysis.
Post Reply