Am 01.03.2016 um 12:35 schrieb Felix Benz-Baldas:
Hello,
we plan to use PDFBox 2.0.0 for converting PDFs to JPEG. We want to convert a
very large number of documents (more than one million).
One question: Is it possible to control the memory-consumption? When I start my java program with
"-Xmx2g" I ran into a "java.lang.OutOfMemoryError: Java heap space" after about
40 minutes.
With "-Xmx4g" the error did not occur.
Is there a way to reduce the memory-consumption?
You could save some memory by using a scratch file:
PDDocument.load(new File("..."), MemoryUsageSetting.setupTempFileOnly());
Btw converting to JPEG only makes sense if your PDFs are photographs.
Anything with sharp edges will look weird. Better use PNG.
Additional to Andreas answers:
- did you close every PDDocument after work?
- did you "lose" every BufferedImage after convert? Or did you rather
keep every image of a PDF in an array?
- if you used a graphics object, did you call dispose()?
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]