Free Support Forum -

Problem with memory consumption in Aspose.Pdf


if I embed large PNG files (6200x4500 pixels, size: about 45M) into a pdf file the memory consumption of Aspose rises up to 280M when calling Document.Save() (see the following code sample, last line):

Aspose.Pdf.Generator.Pdf Document = new Aspose.Pdf.Generator.Pdf();

Aspose.Pdf.Generator.Section Section = new Aspose.Pdf.Generator.Section();

Aspose.Pdf.Generator.Image Image = new Aspose.Pdf.Generator.Image(Section);
Image.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Png;
Image.ImageInfo.ImageStream = System.IO.File.OpenRead();


In our case the problem is that the memory consumption is too high…

Can you please tell me when this problem can be resolved?

Best regards,
Sacha End

Hi Sacha,

Thanks for contacting support and sorry for the delayed response.

I have tested the scenario using one of my sample image files and I did not notice any significant increase in memory consumption during Image to PDF conversion. I have used Resource Monitor to observe the memory consumption/utilization.

Can you please share the source Image file (you may upload it over FTP or some free file sharer) and also share some details regarding the steps that you are following to determine the memory utilization, so that we can again test the scenario at our end. We are sorry for your inconvenience.


thank you for your answer. The source image file is available at
<!–[if gte mso 9]>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Normale Tabelle"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

I determine the memory utilization with


Best regards,
Sacha End

Hi Sacha,

Sorry for the inconvenience faced. I've managed to observe the memory consumption issue. For further investigation I've logged an issue in our issue tracking system as PDFNEWNET-34979 and also linked your request to it. We will keep you update via this thread regarding the issue status.

Please feel free to contact us for any further assistance.

Best Regards

Hi Sacha,

Thanks for your patience.

We have made some progress in terms of memory while converting Image files to PDF format. I would recommend you to try using the following (DOM) approach to convert Image files to PDF format.


string outFile = “input.pdf”;<o:p></o:p>

string inFile = "source.png";

long size0 = GC.GetTotalMemory(false) / 1048576;

Document doc = new Document();

Page page = doc.Pages.Add();

Aspose.Pdf.Image img = new Aspose.Pdf.Image();

img.File = inFile;


long size1 = GC.GetTotalMemory(false) / 1048576;


long size2 = GC.GetTotalMemory(false) / 1048576;




The issues you have found earlier (filed as PDFNEWNET-34979) have been fixed in Aspose.Pdf for .NET 7.8.0update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.