We have developed a windows service using GroupDocs.Conversion for .NET 19.1
We see that when we call conversion functions, memory is consumed and never released.
Our implementation is based in the code sample.
GroupDocs.Conversion.Config.ConversionConfig config = new GroupDocs.Conversion.Config.ConversionConfig {
StoragePath = “.”,
OutputPath = “.”,
TempDataHandler = new MyTempDataHandler ()
};
GroupDocs.Conversion.Handler.ConversionHandler Handler = new GroupDocs.Conversion.Handler.ConversionHandler (config);
var result = Handler.Convert (source, new GroupDocs.Conversion.Options.Save.PdfSaveOptions ());
result.Save (target);
We have tried calling GC.Collector, but it does not work.
After a while, the service demands too much memory and stops working.
@berenice.lopez,
Can you please share a simple (console based) application along-with sample document/file using that issue could be reproduced? Also share screen-cast of memory usage and not released back.
We tried to reproduce this issue at our end but API doesn’t consume much memory and releases the memory once conversion process is completed - memory usage.JPG (30.2 KB)
I attach a console application, the code and the source file we are using. The applications goes into a loop that converts the source file. It usually converts fine the first time, after the second or third convertion a memory exception is thrown. Then the convertion is tried again and works fine but the memory error happends again.
This is the error exception output.
at Aspose.Slides.Presentation.(Stream )
at Aspose.Slides.Presentation…ctor(Stream stream, LoadOptions loadOptions)
at .? ? (LoadOptions )
at ? .? ? (Stream , LoadOptions )
at? .(FileDescription , Stream , LoadOptions , SaveOptions)
at? .? ? (String , LoadOptions , SaveOptions )
at GroupDocs.Conversion.Handler.ConversionHandler.Convert(String guid, LoadOptions loadOptions, SaveOptions saveOptions)
at GroupDocs.Conversion.Handler.ConversionHandler.Convert(String guid, SaveOptions saveOptions)
at testPdf.Program.Main(String[] args) in c:\Users\Antonio\Documents\Visual Studio 2012\Projects\CommerceFiel\testPdf\Program.cs:line 27
Contador: 27
Aspose.Slides.PptxReadException: Out of memory. —> System.OutOfMemoryException: Out of memory.
at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
at System.Drawing.Image.FromStream(Stream stream)
at Aspose.Slides.ImageCollection.AddImage(MemoryStream stream)
at Aspose.Slides.ImageCollection.AddImage(Byte[] buffer)
at Aspose.Slides.? ?. )
at Aspose.Slides.? ?. )
at Aspose.Slides? ?.( , IPresentation )
at Aspose.Slides? ?.(Presentation , Stream , InterruptionToken )
— End of inner exception stack trace —
at Aspose.Slides? ?.(Presentation , Stream , InterruptionToken )
at Aspose.Slides.Presentation.(Stream , Boolean )
at Aspose.Slides.Presentation.(Stream , Boolean )
at Aspose.Slides.Presentation.(Stream )
at Aspose.Slides.Presentation…ctor(Stream stream, LoadOptions loadOptions)
at .? ? (LoadOptions )
at ? .? ? (Stream , LoadOptions )
at? .(FileDescription , Stream , LoadOptions , SaveOptions)
at? .? ? (String , LoadOptions , SaveOptions )
at GroupDocs.Conversion.Handler.ConversionHandler.Convert(String guid, LoadOptions loadOptions, SaveOptions saveOptions)
at GroupDocs.Conversion.Handler.ConversionHandler.Convert(String guid, SaveOptions saveOptions)
at testPdf.Program.Main(String[] args) in c:\Users\Antonio\Documents\Visual Studio 2012\Projects\CommerceFiel\testPdf\Program.cs:line 27
Contador: 28testPdf.zip (2.5 KB)
sample_code.zip (500 Bytes)
@berenice.lopez,
Please share problematic file again. testPDF folder only contains a exe file.
Sorry for the delay. I attach the sample file…
I think the problem is the size… Can you share with me an email account to send the link to download?
@berenice.lopez,
Please upload the problematic file to some cloud storage (Dropbox, Google drive etc.) and post the shareable link here. You can delete the file from storage once we download it.