Hello list,
I'm trying to render rather large pdf files with pdfBox (current) and I'm running into memory issues. I created the PDDocument with .setupTempFileOnly() and I can see it's creating a scratch file. However it still consumes loads of memory and in the end it crashes with an OutOfMemoryException. The heap dump show loads of COSStream objects. My question: is this a known bug / limitation ? Is there a workaround ? Some details: - Of course I increased xmx, but sooner or later it will run out of memory. - I'm opening a new PDPageContentStream for each element (like a table or a paragraph), is this the correct way to do things or am I supposed to only have one stream ? (note: I'm using boxable, they create a stream for each table) - I noticed the saveIncremental() method, but it states that this can only be used when the pdf has been read from a file. Now i could try to create the first page, then save the file and load it again to add some pages and then call this method. Is this feasible ? - The resulting pdf will be about 5GB in size, this is a hard requirement. Regards, Ralf