Memory allocation failed `No such file or directory' error

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
aneiman

Memory allocation failed `No such file or directory' error

Post by aneiman »

I am redacting n-page documents using Imagemagick. The documents are broken down into n 1-page TIF files, redacted, and then merged back together.

The first set of commands looks like this:

Code: Select all

convert.exe ( "D:\Release\Backfile\Images\00092240.TIF" ) +matte -compress group4 -limit memory 1 -limit map 1 -define tiff:rows-per-strip=1 "D:\Release\Backfile\Redacted\\1977___004___0003_01567.tif"
The final command which merges all of the files together looks like this:

Code: Select all

convert.exe D:\Release\Backfile\Redacted\\1977___004___0003_*.tif +matte -compress group4 -limit memory 1 -limit map 1 -define tiff:rows-per-strip=1 "D:\Release\Backfile\Redacted\\1977___004___0003.tif"
With a particular document, which is a little bit longer than 1500 pages, or 1500 1-page TIF files to be merged together, the process errors about at page 831:

Code: Select all

convert: Memory allocation failed `No such file or directory'.
I have successfully done this with documents up to and including 1100 pages, so I don't think it's a limitation caused by a page count or anything. The document in question was scanned from microfilm but the other documents were scanned from normal page.

I will try to post the actual document but need to confirm it's okay with the client first.

I ran the commands manually with the verbose output: http://public.strahd98.fastmail.fm/work/merge.zip
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Memory allocation failed `No such file or directory' error

Post by magick »

Run a process monitor and track how much memory ImageMagick is using. ImageMagick requires 1 to 5 scanlines of pixels for each image plus any metadata associated with each image. Still with 1500 images the memory consumption should be under 80mb. We know of no leaks in ImageMagick 6.3.7 at this time. The TIFF library consumes memory as well so the problem could be with the TIFF delegate library.

We will need to look at the image. You can post a PM (private-message) once you get permission from your client.
Post Reply