Memory allocation failed even if memory is not exhausted

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
oyvind.eide

Memory allocation failed even if memory is not exhausted

Post by oyvind.eide »

I am running convert on a computer with the following settings for memory usage:

> convert -list resource
File Area Memory Map Disk
------------------------------------------------
192 64gb 48gb 256gb 4eb

The image USD_UIO_2713046.tif is 2584x3981 pixels. The following command is OK:

> convert -resize 2584x3981 USD_UIO_2713046.tif temp.jpg

But trying to resize to anything smaller gives a memory allocation failed error:

> convert -debug Resource -resize 1000x1000 USD_UIO_2713046.tif temp.jpg
2007-05-31T08:52:38+02:00 0:22 20.490u 6.2.9 Resource convert[22158]: resource.c/unknown/216/Resource
Area: 78.4828mb/78.4828mb/64gb
2007-05-31T08:52:38+02:00 0:22 20.490u 6.2.9 Resource convert[22158]: resource.c/unknown/216/Resource
Memory: 78.4828mb/78.4828mb/48gb
2007-05-31T08:52:42+02:00 0:26 24.540u 6.2.9 Resource convert[22158]: resource.c/unknown/216/Resource
Area: 4.95148mb/4.95148mb/64gb
2007-05-31T08:52:42+02:00 0:26 24.540u 6.2.9 Resource convert[22158]: resource.c/unknown/216/Resource
Memory: 4.95148mb/83.4343mb/48gb
convert: Memory allocation failed `Not enough space'.
>

There is plenty of memory and temp disc space free.

The input image can be found at:

http://folk.uio.no/oeide/USD_UIO_2713046.tif

Version info:

Solaris
Machine hardware: sun4u
OS version: 5.8
Processor type: sparc
Hardware: SUNW,Sun-Fire-880

> convert --version
Version: ImageMagick 6.2.9 09/15/06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC


--

Regards,

Øyvind Eide
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Memory allocation failed even if memory is not exhausted

Post by magick »

We tried your command with the latest release, 6.3.4-4, and it worked without complaint. In regards to memory, ImageMagick controls the amount of memory it consumes but has no control over any delegate library. Its possible the memory allocation exception occurs within the TIFF library.
oyvind.eide

Re: Memory allocation failed even if memory is not exhausted

Post by oyvind.eide »

Thank you for answering so quickly, I will try upgrading and see if that helps.


--

Regards,

Øyvind Eide
Post Reply