> On 24 Jun 2016, at 00:55, Ankit Agarwal <[email protected]> wrote: > > Hi, > When i try to covert pdf to image then for some pdfs i get a "out of > memory" error. So i increased heap size and then i again got the error for > some different pdf file. > for the time being assume I have no memory leak from other objects. So what > would be the reason for this memory out of error? > Would it be just that the image is so large(which is not the case i think) > that it consumes heap, or maybe pdfbox stores buffered image of each pages > in its memory and this contributes to the growing heap size? > Any insight would be wonderful.
Usually it’s because the PDF contains a compressed image which is very large when decompressed. So the file isn’t big on disk, but it is in memory. Try using a 32-bit JVM as these use less memory. 1GB of heap is usually enough but you can go larger. — John --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

