ImageToBlob memory usage 32bit vs. 64bit

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
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

ImageToBlob memory usage 32bit vs. 64bit

Post by rmagick »

An RMagick user is reporting significantly larger memory usage when running on a 64-bit server vs. a 32-bit server. I believe these are both Intel machines running some flavor of Linux. The method that appears to be sucking up all the memory is ImageToBlob. With a 2000x1000 image in GIF format, the ImageToBlob method uses 2 1/2 times as much memory on the 64-bit machine. The user has configured ImageMagick to use QuantumDepth=8 on both machines.

While I would expect some small change just to account for 64-bit pointers, I would guess that the common quantum depth would make the image roughly the same size.

Do you have any insight into this problem? Any questions I should ask the user to help understand the problem?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageToBlob memory usage 32bit vs. 64bit

Post by magick »

A quantum depth of 8 produces the same size pixel cache on a 32 or 64-bit OS. Unsigned long arrays consume twice as much memory on a 64-bit OS compared to that of a 32-bit system. We suspect the extra memory is consumed by the color reduction algorithm that utilizes unsigned long and long double arrays.
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Re: ImageToBlob memory usage 32bit vs. 64bit

Post by rmagick »

Thanks for your answer. I'll pass this info onto the user.
tvollmer

Re: ImageToBlob memory usage 32bit vs. 64bit

Post by tvollmer »

Actually I am the "user". What I find a little weird: When you save the image to disk (instead of doinf to_blob) it does not consume the memory?!
Logically?
Till
Post Reply