Memory allocation failed `Not enough space'

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
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

Memory allocation failed `Not enough space'

Post by gursch »

I have several tiff files ImageMagick fails to convert (using convert.exe) on Windows. They work perfectly with other tools.

Debug output:

Code: Select all

C:\temp>convert 1118_1139_t_53_w_001.tif out.jpg -debug all
2011-04-16T17:45:16+02:00 0:00.002 0.016u 6.6.9 Configure Magick[988]: utility.c/ExpandFilenames/906/Configure
  Command line: convert {1118_1139_t_53_w_001.tif} {out.jpg} {-debug} {all}
2011-04-16T17:45:16+02:00 0:00.017 0.016u 6.6.9 Configure Magick[988]: nt-base.c/NTRegistryKeyLookup/1600/Configure
  SOFTWARE\ImageMagick\6.6.9\Q:16
2011-04-16T17:45:16+02:00 0:00.030 0.016u 6.6.9 Configure Magick[988]: nt-base.c/NTRegistryKeyLookup/1618/Configure
  ConfigurePath
2011-04-16T17:45:16+02:00 0:00.038 0.016u 6.6.9 Configure Magick[988]: configure.c/GetConfigureOptions/564/Configure
  Searching for configure file: "C:\Program Files\ImageMagick-6.6.9-Q16\config\coder.xml"
2011-04-16T17:45:16+02:00 0:00.051 0.016u 6.6.9 Configure Magick[988]: configure.c/GetConfigureOptions/564/Configure
  Searching for configure file: "C:\Users\ag\.magick\coder.xml"
2011-04-16T17:45:16+02:00 0:00.062 0.016u 6.6.9 Configure Magick[988]: configure.c/GetConfigureOptions/564/Configure
  Searching for configure file: "C:\Program Files\ImageMagick-6.6.9-Q16\coder.xml"
2011-04-16T17:45:16+02:00 0:00.075 0.016u 6.6.9 Configure Magick[988]: coder.c/LoadCoderList/691/Configure
  Loading coder configuration file "C:\Program Files\ImageMagick-6.6.9-Q16\config\coder.xml" ...
2011-04-16T17:45:16+02:00 0:00.087 0.031u 6.6.9 Configure Magick[988]: coder.c/LoadCoderList/691/Configure
  Loading coder configuration file "coder.xml" ...
2011-04-16T17:45:16+02:00 0:00.096 0.047u 6.6.9 Module Magick[988]: module.c/OpenModule/1262/Module
  Searching for module "TIFF" using filename "IM_MOD_RL_TIFF_.dll"
2011-04-16T17:45:16+02:00 0:00.108 0.047u 6.6.9 Module Magick[988]: module.c/GetMagickModulePath/565/Module
  Searching for coder module file "IM_MOD_RL_TIFF_.dll" ...
2011-04-16T17:45:16+02:00 0:00.118 0.047u 6.6.9 Configure Magick[988]: nt-base.c/NTRegistryKeyLookup/1600/Configure
  SOFTWARE\ImageMagick\6.6.9\Q:16
2011-04-16T17:45:16+02:00 0:00.128 0.047u 6.6.9 Configure Magick[988]: nt-base.c/NTRegistryKeyLookup/1618/Configure
  CoderModulesPath
2011-04-16T17:45:16+02:00 0:00.137 0.047u 6.6.9 Module Magick[988]: module.c/OpenModule/1271/Module
  Opening module at path "C:\Program Files\ImageMagick-6.6.9-Q16\modules\coders\IM_MOD_RL_TIFF_.dll"
2011-04-16T17:45:16+02:00 0:00.150 0.047u 6.6.9 Module Magick[988]: module.c/OpenModule/1298/Module
  Method "RegisterTIFFImage" in module "TIFF" at address 72DE5AB0
2011-04-16T17:45:16+02:00 0:00.160 0.047u 6.6.9 Module Magick[988]: module.c/OpenModule/1312/Module
  Method "UnregisterTIFFImage" in module "TIFF" at address 72DE3260
2011-04-16T17:45:16+02:00 0:00.170 0.047u 6.6.9 Policy Magick[988]: policy.c/IsRightsAuthorized/485/Policy
  Domain: Path; rights=Read; pattern="1118_1139_t_53_w_001.tif" ...
2011-04-16T17:45:16+02:00 0:00.199 0.062u 6.6.9 Blob Magick[988]: blob.c/OpenBlob/2480/Blob
    read 3 magic header bytes
2011-04-16T17:45:16+02:00 0:00.209 0.062u 6.6.9 Cache Magick[988]: cache.c/DestroyPixelCache/1502/Cache
  destroy
2011-04-16T17:45:16+02:00 0:00.219 0.062u 6.6.9 Configure Magick[988]: nt-base.c/NTRegistryKeyLookup/1600/Configure
  SOFTWARE\ImageMagick\6.6.9\Q:16
2011-04-16T17:45:16+02:00 0:00.229 0.062u 6.6.9 Configure Magick[988]: nt-base.c/NTRegistryKeyLookup/1618/Configure
  ConfigurePath
2011-04-16T17:45:16+02:00 0:00.239 0.062u 6.6.9 Configure Magick[988]: configure.c/GetConfigureOptions/564/Configure
  Searching for configure file: "C:\Program Files\ImageMagick-6.6.9-Q16\config\magic.xml"
2011-04-16T17:45:16+02:00 0:00.253 0.062u 6.6.9 Configure Magick[988]: configure.c/GetConfigureOptions/564/Configure
  Searching for configure file: "C:\Users\ag\.magick\magic.xml"
2011-04-16T17:45:16+02:00 0:00.264 0.062u 6.6.9 Configure Magick[988]: configure.c/GetConfigureOptions/564/Configure
  Searching for configure file: "C:\Program Files\ImageMagick-6.6.9-Q16\magic.xml"
2011-04-16T17:45:16+02:00 0:00.277 0.062u 6.6.9 Configure Magick[988]: magic.c/LoadMagicList/678/Configure
  Loading magic configure file "C:\Program Files\ImageMagick-6.6.9-Q16\config\magic.xml" ...
2011-04-16T17:45:16+02:00 0:00.289 0.078u 6.6.9 Configure Magick[988]: magic.c/LoadMagicList/678/Configure
  Loading magic configure file "magic.xml" ...
2011-04-16T17:45:16+02:00 0:00.298 0.078u 6.6.9 Policy Magick[988]: policy.c/IsRightsAuthorized/485/Policy
  Domain: Coder; rights=Read; pattern="TIFF" ...
2011-04-16T17:45:16+02:00 0:00.309 0.078u 6.6.9 Policy Magick[988]: policy.c/IsRightsAuthorized/485/Policy
  Domain: Path; rights=Read; pattern="1118_1139_t_53_w_001.tif" ...
2011-04-16T17:45:16+02:00 0:00.318 0.078u 6.6.9 Blob Magick[988]: blob.c/OpenBlob/2480/Blob
    read 3 magic header bytes
2011-04-16T17:45:16+02:00 0:00.326 0.078u 6.6.9 Cache Magick[988]: cache.c/DestroyPixelCache/1502/Cache
  destroy
2011-04-16T17:45:16+02:00 0:00.335 0.094u 6.6.9 Policy Magick[988]: policy.c/IsRightsAuthorized/485/Policy
  Domain: Path; rights=Read; pattern="1118_1139_t_53_w_001.tif" ...
2011-04-16T17:45:17+02:00 0:00.345 0.094u 6.6.9 Blob Magick[988]: blob.c/OpenBlob/2480/Blob
    read 3 magic header bytes
2011-04-16T17:45:17+02:00 0:00.352 0.094u 6.6.9 Exception Magick[988]: tiff.c/TIFFWarnings/706/Exception
  1118_1139_t_53_w_001.tif: wrong data type 7 for "RichTIFFIPTC"; tag ignored. `TIFFReadDirectory'
2011-04-16T17:45:17+02:00 0:00.364 0.094u 6.6.9 Exception Magick[988]: tiff.c/TIFFWarnings/706/Exception
  1118_1139_t_53_w_001.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory'
2011-04-16T17:45:18+02:00 0:01.423 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/925/Coder
  Geometry: 5440x4080
2011-04-16T17:45:18+02:00 0:01.432 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/927/Coder
  Interlace: 1
2011-04-16T17:45:18+02:00 0:01.440 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/929/Coder
  Bits per sample: 16
2011-04-16T17:45:18+02:00 0:01.448 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/931/Coder
  Min sample value: 0
2011-04-16T17:45:18+02:00 0:01.456 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/933/Coder
  Max sample value: 65535
2011-04-16T17:45:18+02:00 0:01.464 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/935/Coder
  Photometric interpretation: RGB
2011-04-16T17:45:18+02:00 0:01.472 1.139u 6.6.9 Coder Magick[988]: tiff.c/ReadTIFFImage/942/Coder
  Image depth: 16
2011-04-16T17:45:35+02:00 0:19.071 18.658u 6.6.9 Exception Magick[988]: string.c/AcquireStringInfo/174/Exception
  Memory allocation failed `Not enough space'
Magick: Memory allocation failed `Not enough space' @ fatal/string.c/AcquireStringInfo/174.
Any idea?

Thanks,
Alexander
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Memory allocation failed `Not enough space'

Post by magick »

Try this command:
  • convert -limit area 0 1118_1139_t_53_w_001.tif out.jpg
If that fails, post a URL to your image so we can download and inspect it.
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

Re: Memory allocation failed `Not enough space'

Post by gursch »

> convert -limit area 0 1118_1139_t_53_w_001.tif out.jpg

Didn't work. I will send you a private message with a download link.

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

Re: Memory allocation failed `Not enough space'

Post by magick »

Your image has a profile with a 37724 tag (Photoshop private tag) that is over 500MB but much more when ImageMagick tries to store it in tree structure in memory. Because of the huge memory requirement for this profile, your system fails to honor the request for memory and ImageMagick exits. The 37724 tag appears to be a custom tag. Do you know why the profile is so large?

The conversion works fine on our Linux system. Under Windows, when we remove the 37724 tag, the resulting TIFF image converts without complaint.
gursch
Posts: 20
Joined: 2010-05-25T02:41:06-07:00
Authentication code: 8675308

Re: Memory allocation failed `Not enough space'

Post by gursch »

> Do you know why the profile is so large?

Unfortunately I don’t know. I know that they are using cameras from Sinar. I guess that the camera puts the raw picture information into that tag (what else could be so large?). I tried the 64bit Version of ImageMagick and the conversion worked. Is there a way to say to ImageMagick to ignore the tag?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Memory allocation failed `Not enough space'

Post by magick »

We could add an option to ignore a tag but it is not currently supported.
Post Reply