"Too many open files" AND "error: can't allocate region"

Post any defects you find in the released or beta versions of the ImageMagick software here. The ImageMagick maintainers carefully monitor this list and will work diligently to repair any reported problems. When posting a bug report, please specify both the ImageMagick version and operating system you are using.

"Too many open files" AND "error: can't allocate region"

Postby fellowshipofone » 2010-02-10T02:31:33+00:00

Hi,

I am trying to create 256*256px PNG images from a 32768*32768px file.

Note: It works just great with a 8192*8192px file, so the software is really just hitting limits.

Bug #1
On Machine 1, Mac Book Pro 4GB RAM, I ran out of memory and swap quickly as "convert" required about 15GB of RAM. When switching to "-limit area 0", I quickly got this "Too many open files" errors and there does not seem to be anything I can do using "-limit files 128" or anything similar.

convert -limit area 0 -monitor sourceimage.jpg -crop 256x256 +repage png32:resultimages.png

(Updated: here is what I get precisely)
Code: Select all
load image[map-U7ghOq]: 32767 of 32768, 100% complete
Mogrify[Image]: 2502 of 2503, 100% completeplete
convert: unable to open file `/var/folders/g5/g5EFHciNGBirywxQFvfIwU+++TI/-Tmp-/magick-sOQZSjns': Too many open files @ cache.c/ReadPixelCachePixels/4731.


Bug #2
On Machine 2, Mac Pro with 13GB RAM, I have not monitored it but I (unexpectedly?) ran out of memory twice. The second time I used "-limit area 10gb" which did not change anything. Here is the output I get both times:

convert -monitor sourceimage.jpg -crop 256x256 +repage png32:resultimages.png


Code: Select all
load image[map-ITLVaB]: 32767 of 32768, 100% completeete
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=524288) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert(87563) malloc: *** mmap(size=24576) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
convert: Memory allocation failed `Cannot allocate memory' @ string.c/AcquireStringInfo/173.



Either way, my problem needs a quick solution, so a

I have seen both bugs reported for earlier releases of IM. Right now I am running ImageMagick @6.5.9-0_0+q16 installed with MacPorts.

Thanks for your help.
fellowshipofone
 
Posts: 2
Joined: 2010-02-10T01:57:55+00:00

Re: "Too many open files" AND "error: can't allocate regi

Postby magick » 2010-02-10T08:54:48+00:00

We can reproduce the problem you posted and will have a patch in ImageMagick 6.5.9-4 by sometime tomorrow. Thanks.
User avatar
magick
Site Admin
 
Posts: 6518
Joined: 2003-05-31T11:32:55+00:00

Re: "Too many open files" AND "error: can't allocate regi

Postby fellowshipofone » 2010-02-10T09:09:18+00:00

Thanks a lot! I really appreciate the quick answer.
fellowshipofone
 
Posts: 2
Joined: 2010-02-10T01:57:55+00:00


Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests