Hello I was wondering if there have been any improvements in memory management 
since release 1.3.4. Specifically we are using the PdfCopyFields object to 
perform a merge.
Here is a snippet of our code that is doing the merge.

private PdfCopyFields pdfCopyFields        = null;
   public byte[] generateMergedPdf() throws InterruptedException
   {
      shutdownOrderedMergeService();
     
      // merge content
      byte[] myMergedContent = null;
      synchronized (pdfCopyFields)
      {
              try
              {
                 if (pdfCopyFields != null)
                      {
                    if (bookmarkList != null && bookmarkList.size() > 0)
                              {
                       pdfCopyFields.setOutlines(bookmarkList);
                              }
                             
                            // generate merged document
                    pdfCopyFields.close();  
                     
                              myMergedContent = 
byteArrayOutputStream.toByteArray();
                      }
              }
              finally
              {
                 cleanupResources();
              }
      }
     
      return myMergedContent;
   }

We had a couple of users attempting to merge pdf documents totaling 112 meg in 
size twice.
Under load (i.e. High memory usage) we see the following exception: We have 
upped the process to 1.5 gig of memory. Just wondering if you have made any 
memory optimizations to iText  that would warrant us to upgrade to the latest 
release.

java.lang.RuntimeException: The document is not open.
        at com.lowagie.text.pdf.PdfWriter.getDirectContent(Unknown Source)
        at com.lowagie.text.pdf.PdfDocument.newPage(Unknown Source)
        at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
        at com.lowagie.text.pdf.PdfCopyFieldsImp.closeIt(Unknown Source)
        at com.lowagie.text.pdf.PdfCopyFieldsImp.close(Unknown Source)
        at com.lowagie.text.pdf.PdfCopyFields.close(Unknown Source)
        at 
com.emagic.infrastructure.util.pdf.PdfMergeProcessor.generateMergedPdf(PdfMergeProcessor.java:567)
        at 
com.emagic.utilities.imaging.services.ImagingMergeRequestAssembler.performMerge(ImagingMergeRequestAssembler.java:260)
        at 
com.emagic.utilities.imaging.services.ImagingMergeRequestAssembler.mergeFolderDocuments(ImagingMergeRequestAssembler.java:160)
        at 
com.emagic.utilities.imaging.services.ImagingServiceRequestProcessorMerge.processRequest(ImagingServiceRequestProcessorMerge.java:76)
        at 
com.emagic.utilities.imaging.services.ImagingServiceServlet.processClientRequest(ImagingServiceServlet.java:330)
        at 
com.emagic.utilities.imaging.services.ImagingServiceServlet.doPost(ImagingServiceServlet.java:120)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
        at 
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6720)
        at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at 
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3766)
        at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2651)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

The date on the class files is 9-22-2005. So assuming we are running with 
version 1.3.4

Thanks for any help

Scott


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to