Sign In  Sign Up Live-Chat

Very Large Docs Memory Leak

Last post 11-30-2008, 12:03 PM by Hans.firefox. 9 replies.
Sort Posts: Previous Next
  •  08-27-2008, 2:23 AM 141376

    Very Large Docs Memory Leak

    Hello.
    When creating a very large PDF doc, a lot of memory is consumed and not being released.
    Attached please find the reproduction program demonstrating 1GB (!!!) memory allocation.
    Please advise!
    Thanks,
    Eddie
     
  •  08-27-2008, 3:51 AM 141389 in reply to 141376

    Re: Very Large Docs Memory Leak

    Hello Eddie,

    I cannot find the program in attachment. Can you please try sharing it once again.


    Nayyer Shahbaz
    Support Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-27-2008, 6:27 AM 141412 in reply to 141389

    Re: Very Large Docs Memory Leak

    Attachment: Present (inaccessible)
    Hi Nayyer,
    Hope this time it will work smoothly.
    Thanks,
    Eddie
     
  •  08-27-2008, 11:57 AM 141484 in reply to 141412

    Re: Very Large Docs Memory Leak

    Hi Eddie,

    We apologize for your inconvenience. I have tested the issue and I’m able to reproduce the same problem. I have logged it in our issue tracking system as PDFNET-5842. We will investigate this issue in detail and will keep you updated on the status of a correction.


    Nayyer Shahbaz
    Support Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-03-2008, 12:00 AM 142138 in reply to 141484

    Re: Very Large Docs Memory Leak

    Hello Nayyer,

    Please note that the PDF generator is an integral part of my whole application. Thus crashing Aspose.Pdf is a real crisis!

    Your prompt attention will be highly appreciated.
    Please let me know your estimation regarding solving this problem.

    Thanks a lot!
    Eddie
     
  •  09-03-2008, 4:22 AM 142170 in reply to 142138

    Re: Very Large Docs Memory Leak

    Hi Eddie,

    We have resolved the memory leak problem. But the memory usage is high and the performance is not ideal. I can explain why.

    Firstly, the xml is very large. It has 173,883 lines. The corresponding pdf object of  7845 sections and each section contains a table of 5 rows. This pdf has more than 1000 pages after conversion. 

    Secondly, in Aspose.Pdf, we write the paragraph into file after all the paragraphs are positioned. During this time, all of these paragraphs will be cached in memory. One more thing, it is a memory expensive job to position tables. As table is more complicated than text, so we recommend you use text rather than table, if possible.

    We will send you an update which will resolve the memory leak problem shortly. But for a complete solution, we have to redesign our codes and need about 2-3 months. As a workaround, please use text, if possible. Sorry for inconvenience.

    Thanks.


    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-09-2008, 2:39 AM 143066 in reply to 142170

    Re: Very Large Docs Memory Leak

    Dear Eddie,

    We have published our new release Aspose.Pdf 3.8.0.0. Please try it.

    In my test, it takes about 3min 13s to generate the pdf file which has 901 pages.

    Best regards.


    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-09-2008, 3:06 PM 143190 in reply to 143066

    Re: Very Large Docs Memory Leak

    Dear Eddie,

    Please add the following codes before you call pdf.Save() method. It will improve the performance significantly.

    pdf.IsTruetypeFontMapCached = true;  //cache fonts for performance
    pdf.TruetypeFontMapPath = "F:/temp"; //specify the dir to cache fonts info

    Thanks.
    Best regards.



    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  11-30-2008, 6:17 AM 154636 in reply to 143190

    Re: Very Large Docs Memory Leak

    Dear Hans,
    Both performance and memory consumption has dramatically improved by adding the provided code and using Aspose.Pdf.dll v3.8.0.0
    However, the memory leak problem has not disappear... If you try to create few very big PDF documents one after another you'll see that there is an unreleased memory...
    Please advise,
    Eddie

     
  •  11-30-2008, 12:03 PM 154649 in reply to 154636

    Re: Very Large Docs Memory Leak

    Dear Eddie,

    I am afraid it is a known issue that the memory usage is very high when processing large paragraphs(especially table). We are working on it and hard to resolve it in short time. As a workaround, you can use direct-to-file mode in this case. Please refer to http://www.aspose.com/documentation/file-format-components/aspose.pdf-for-.net-and-java/writing-pdf-directly.html for help. Thanks.

    Best regards.

    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML