Page 1 of 1

File size limit exceeded (core dumped)

Posted: 2008-04-15T06:08:34-07:00
by mij
I'm trying to convert a pdf into a quite good quality jpg (750x1005) but the following error happens:

Code: Select all

> convert  -density 400 magazine1.pdf -resize 750x1005 %01d.jpg
File size limit exceeded (core dumped)
Is there somthing wrong with my command? is it due to hardware limitations?
I'm using ubuntu 7.10 and ImageMagick 6.4.0

Re: File size limit exceeded (core dumped)

Posted: 2008-04-15T07:58:11-07:00
by magick
Your system administrator must have imposed limitation on your account for file size creation.. Just run limit (or ulimit) command to find the file size limitation.

Re: File size limit exceeded (core dumped)

Posted: 2008-04-15T16:41:15-07:00
by mij
Here it is the ulimit command output:

Code: Select all

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 8182
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 8182
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
So it looks like I don't have any limit on file size creation. Do you find any other relevant information in the output?
Furthermore, when I convert one single page of the pdf to jpg, it works OK:

Code: Select all

> convert  -density 400 magazine1.pdf[1] -resize 750x1005 %01d.jpg
But when I try to convert the whole file, it crashes as described in the first post.
BTW I'm running this on my home laptop, so I am the administrator myself, and my version of ImageMagick is 6.2.4.

Re: File size limit exceeded (core dumped)

Posted: 2008-04-15T18:04:58-07:00
by magick
Check your system limits, perhaps /etc/security/limits.conf. Is there a fsize limit? The exception you got is coming from the operating system, not from ImageMagick.

Re: File size limit exceeded (core dumped)

Posted: 2008-04-15T18:49:00-07:00
by mij
No limitations on /etc/security/limits.conf
I also think that the exception is coming from my OS. However I checked memory usage and convert was eating as much as 350mb RAM when it crashed, I think it's too much for handling a 7,7mb pdf file. Moreover, I can convert the whole pdf into separate jpg files if I do one page at a time (as explained before).
Can some bad configuration on my computer be the cause of such a high memory usage by the "convert" process??

Re: File size limit exceeded (core dumped)

Posted: 2008-04-15T19:39:51-07:00
by magick
To reduce the memory usage add -limit memory 16mb -limit map 32mb to your command line.

Re: File size limit exceeded (core dumped)

Posted: 2008-04-18T02:22:23-07:00
by mij
I added -limit memory 16mb -limit map 32mb to the command.
Convert's memory usage remained steady at 3.0Mb, then the aforementioned "memory limit exceeded (core dumped)" error happened and memory usage started to grow until 450mb (when I decided to kill the process). The same behavior as before.

I tried with a smaller pdf, and again memory usage was more or less the same with or without the -limit option (peaking at about 500Mb for a 2,2mb file), but it worked o.k. so I suppose that memory usage grows quickly with the size of the pdf being processed, so my computer just cannot handle the 7,7 Mb one, is it possible?

However, when I convert a single page, memory usage is only about 150Mb, so If there's a way to know the number of pages of a given pdf, I can make a batch file which uses convert for each page separately, if I find no other solution

Any suggestion?

Re: File size limit exceeded (core dumped)

Posted: 2008-04-18T05:32:23-07:00
by magick
Can you post a URL to your PDF? We want to see if we can reproduce the problem.

Re: File size limit exceeded (core dumped)

Posted: 2008-04-18T17:32:10-07:00
by mij
thank you very much indeed for you interest!
You can find the pdf file on:
http://gen-t.es/pdf/RevistaGent2.pdf

Re: File size limit exceeded (core dumped)

Posted: 2008-04-20T17:15:48-07:00
by magick
Ghostscipt 8.62 failed to read your PDF. It returns an unrecoverable error. Unless Ghostscipt can read your PDF there is no hope that ImageMagick can process it. Note that ImageMagick used very little memory but Ghostscript required 85MB's. Do you have another PDF we can test?

Re: File size limit exceeded (core dumped)

Posted: 2008-04-26T07:56:06-07:00
by mij
Here you can find a pdf which causes the same error:
http://www.euroespespublishing.com/descargas/GenT1.pdf

I successfully converted the whole file to jpg creating a batch program to launch individual "convert" commands for each page. No ghostscript errors occurred (I use ghostscript v8.61).
However, when I try to use a single "convert" command, the size limit exceeded error still happens.

Memory usage followed more or less the same pattern as before: first, "gs" uses more or less 80mb of memory, while "convert" remains steady at 3Mb, once "gs" finishes, "convert" memory usage grows to more than 800 Mb and either finish successfully (if it's converting a single page) or crashes (if not).

The output using the -verbose mode is similar to this for each page being converted:
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 "-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g3622x5039" "-r400x400" -dFirstPage=57 -dLastPage=57 "-sOutputFile=/tmp/magick-XXgdy6Eb" "-f/tmp/magick-XXqrlK0F" "-f/tmp/magicaMctjH"/tmp/magick-XXgdy6Eb[0] BMP 3622x5039 PseudoClass 256c 69.7mb 1.410u 0:03
/tmp/magick-XXgdy6Eb[1] BMP 3622x5039 PseudoClass 256c 69.7mb 1.040u 0:02
/tmp/magick-XXgdy6Eb[2] BMP 3622x5039 PseudoClass 256c 69.7mb 0.680u 0:02
/tmp/magick-XXgdy6Eb[3] BMP 3622x5039 PseudoClass 256c 69.7mb 0.340u 0:02
GenT1.pdf PDF 3622x5039 3622x5039+0+0 DirectClass 69.7mb 1.170u 0:07
GenT1.pdf PDF 3622x5039=>705x981 705x981+0+0 DirectClass 69.7mb 3.770u 0:05
GenT1.pdf=>56.jpg PDF 3622x5039=>705x981 705x981+0+0 DirectClass 915kb 0.140u 0:02

Thank you for your time.

Re: File size limit exceeded (core dumped)

Posted: 2008-04-26T14:39:57-07:00
by magick
The problem appears to be within Ghostscript. You might get a useful answer if you post the problem to their mailing lists.