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

OutOFMemoryError(Heap Space)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Not A Problem
    • 2.0.1, 2.0.2
    • None
    • Documentation, Rendering
    • Windows 7, jre 1.8 ,

    Description

      Here's a segment of my code.
      //code
      try
      {
      PDFRenderer pdfRenderer = new PDFRenderer(pdDoc);
      BufferedImage image = pdfRenderer.renderImageWithDPI(page-1, 300,ImageType.GRAY);
      ImageIOUtil.writeImage(image,"G:/Trial/tempImg.png", 300);
      //some codes 1
      }
      catch(Exception e)
      {
      //printing something
      }
      finally{
      //some codes 2
      }
      //code
      When I debugged this code, i saw that just after the line renderImage withDPI ,control reaches finally and just after finally I get out of memory error. After the buffered image line ideally control sgould execute "some codes 1" which are just after that line but instead control skips all that and reaches finally, it doesnt even go to catch , so I cant understand why is this happening.
      Please provide some insight on this.

      Attachments

        Activity

          People

            Unassigned Unassigned
            anky Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: