Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2847

mergeDocumentsNonSeq does not utilize scratchFile

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 1.8.10, 2.0.0
    • Fix Version/s: 1.8.10, 2.0.0
    • Component/s: Utilities
    • Labels:
      None

      Description

      I noticed when merging relatively large pdfs (1gb) that the heap would grow by at least the same amount until complete, even when I call mergeDocumentsNonSeq() and supplying a read/write scratchfile.

      When I looked at the source for mergeDocuments(bool, RandomAccess), it looks like the scratch file is never used.

      private void mergeDocuments(boolean isNonSeq, RandomAccess scratchFile) 
                  throws IOException, COSVisitorException
      {
      //...snip
      
                      if (isNonSeq)
                      {
                          source = PDDocument.loadNonSeq(sourceFile, null);
                      }
      //...snip
      }
      

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              jtdevos Jim deVos
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: