Page 1 of 1

Distributed Pixel Cache Exception

Posted: 2013-11-21T10:33:13-07:00
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!

Re: Distributed Pixel Cache Exception

Posted: 2013-11-21T13:10:43-07:00
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.