Hi. Thanks for your time.
I am using PDF box and am having trouble creating large PDFS (50,000+ pages).
The heap size of the process is capped, but with the temp file active (which I
can see being created) I didn't think this would matter.
Here is what I am doing in a very condensed form:
MEMORY_SETTING = MemoryUsageSetting.setupTempFileOnly();
PDDocument pdf = new PDDocument(MEMORY_SETTING);
for (...) {
String text = [generate page text]
PDPage page = new PDPage(PDRectangle.LETTER);
try (PDPageContentStream contentStream = new
PDPageContentStream(doc, page, PDPageContentStream.AppendMode.OVERWRITE,
false)) {
contentStream.endText();
doc.addPage(page);
}
When I do a heap dump, I see over 100 MG of memory taken by 42,000 instances of
ScratchFileBuffer.currentPage
Is there something I am going wrong here? Or is this a bug? It seems like I
must be doing something wrong / forgetting to do something, since this is a
problem in 2 and 3-RC1.
Thanks again,
Mark Claassen
Senior Software Engineer
Donnell Systems, Inc.
130 South Main Street
Leighton Plaza Suite 375
South Bend, INĀ 46601
E-mail: mailto:[email protected]
Voice: (574)232-3784
Fax: (574)232-4014
Disclaimer:
The opinions provided herein do not necessarily state or reflect
those of Donnell Systems, Inc.(DSI). DSI makes no warranty for and
assumes no legal liability or responsibility for the posting.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]