Critical Memory leak in Aspose.PDF for .Net

Hi,
This is a critical issue and an important functionality for our application.

There is a memory leak issue with XML using for PDF. The server process grows out to 1.5 from 300-400 MB and gives permission denied error on the pdf file. Attached is the XML file trying to convert. And below is the code to bind it using PDF object.

Aspose.Pdf.License license = new Aspose.Pdf.License();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
section.PageInfo.PageWidth = Aspose.Pdf.Generator.PageSize.A4Width;
section.PageInfo.PageHeight = Aspose.Pdf.Generator.PageSize.A4Height;
section.IsLandscape = true;

XmlDocument xd = new System.Xml.XmlDocument();
xd.LoadXml(inputDataLeftNav);

pdf.BindXML(xd, null);
pdf.Save("testfile.pdf");
pdf = null;

Hi Vishal,


Thanks for contacting support.

I have tested the scenario where I have tried converting the attached XML file to PDF format using Aspose.Pdf for .NET 7.7.0 where I have used Visual Studio 2010 application running over Windows 7 (X64) on Intel 3.4 Ghz with 8GB of RAM and I did not notice any Memory leak issue. Can you please share some further details which can help us in replicating this issue at our end. We are sorry for this inconvenience.

The reason you are getting permission denied error might be related to the fact that the user does not have access privileges to the location where PDF file is being generated.

PS, If you are using an older version, can you please try upgrading to the latest release version.

Hi,

I downloaded the latest version of 7.7.0 and tested again on Win Vista, Visual Studio 10, .Net Framework 4.0. I have also tested the same version on Windows 2008 Server, IIS 7 with the same memory leak issue. The app process grows from 200/300 MB to 1.5 GB and then gives a permission error. And there is no error and absolutely works fine when I try to export another xml file with less data. And the permission error it gives has nothing to do with the permissions in the folder but it seems like the process holds a lock on it since it is waiting to dump the result in it. Please let me know how else I can

Thanks

Hi Vishal,


Thanks for sharing the details.

I have again tested the scenario where I have tried converting the XML file to PDF over another Windows7 (X64) machine while using Visual Studio 2010 application with target platform of application set to .NET Framework 4.0 and I am unable to notice Memory leak issue. However for the sake of further investigation, I have logged it as PDFNEWNET-34988 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time.

We are really sorry for this inconvenience.

Hi Shahbaz,

Do we have an update? It is kind of holding up one of our releases. Is there a better way to do this?

Thanks
Vishal

Hi Vishal,


As you can see from my last comments, I could not replicate the issue over Windows 7 + Visual Studio 2010 environment so in order to further investigate, I logged an investigation task in our issue tracking system. We are trying to replicate this problem and once we are successful in reproducing it, then we would be in position to further investigate and figure out the reasons of this problem. Please be patient and spare us little time. As soon as we have made some further progress, we would be more than happy to update you with the status of correction.

We are sorry for this delay and inconvenience.

Hi Shahbaz,

Do we have an update here?

Thanks
Vishal

Hi Vishal,


We tried replicating this issue but I am afraid we could not notice the problem related to Memory leak. Nonetheless we are now working on replicating this issue on a separate Windows 2008 R2 machine and will keep you posted with our findings. We are sorry for this delay and inconvenience.

Hi Shahbaz,

Do we have an update here now? I did provide the sample with the code.

Thanks
Vishal

Hi Vishal


Thanks for your inquiry. I’m afraid while testing the scenario with Aspose.Pdf for .NET 8.0 and Windows 7/Windows server 2008 R2, I’m unable to notice any memory leak but an empty file is being generated. I’ve logged another issue as PDFNEWNET-35384 in our issue tracking system for further investigation and resolution.

Can you please download and try latest version of Aspose.Pdf for .NET? Hopefully your issue will be resolved. If issue persist then please share a console application to replicate the issue.

Thanks for your patience and cooperation.

Best Regards,

Hi Vishal,


We are sorry for the delayed reply. Can you please confirm whether upgrading API version resolved the issue or it still persist?

Moreover in reference to empty file generation issue(PDFNEWNET-35384), It looks like empty file is generated because there is no referenced image-files on expected place. So, it seems may be memory leaks issue exist in processing of referenced images rather than XML file processing. (e.g in XML referenced image C:\Working\EEIDB\EEIDBWeb\EEIDBWeb\Images\images\icon_ic.png, C:\Working\EEIDB\EEIDBWeb\EEIDBWeb\Images\images\icon_hp.png etc but they are absent). As suggested above please first test the scenario with latest API release i.e. Aspose.Pdf for .NET 9.1.0, If issue still persist then we need those image files to proceed with the investigation.

We are sorry for the inconvenience caused.

Best Regards,

Is there any status update on this issue?

Hi Manoj,


Thanks for your inquiry. Please note above reported issues are related to specific customer scenario and we have already suggested him solution/workaround. We will appreciate it if you please share your issue details, so we will guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,