Sachin Mali created PDFBOX-4144:

             Summary: Pdf to image conversion not releasing memory after 
                 Key: PDFBOX-4144
             Project: PDFBox
          Issue Type: Bug
          Components: Parsing, Rendering
    Affects Versions: 2.0.8
         Environment: Apache Tomcat/8.0.33, Linux, JDK 1.8  
            Reporter: Sachin Mali

I have written a program that accepts pdf and convert it to image. Please see 
the below code for your reference.

ByteArrayInputStream ipStream = new 
PDDocument documentUploaded = 
         documentUploaded.setResourceCache(new MyResourceCache());

//Disabled a resource cache

         PDFRenderer pdfRenderer = new PDFRenderer(documentUploaded);
         int pageCounter = 0;
         for (PDPage page : documentUploaded.getPages())
            BufferedImage bim = pdfRenderer.renderImageWithDPI(pageCounter, 
300, ImageType.RGB);   
             pageCounter = pageCounter + 1;


// Some code here

               bim = null;



After/Before conversion i printed heap size used by using 
Runtime.getRuntime().totalMemory() . Also I checked top command to see 
percentage of memory used.But in both cases the memory keeps increasing after 
each conversion and does not release used memory.After tomcat restart I get 
cleaned memory.


This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to