I am using Syncfusion.Pdf.Net.Core(Version:21.1.41) to generate PDF from MemoryStream.
But memory is not released after I tried with different way.
Here is the logic, any idea how to release the memory after the process?
// Save the PDF document to stream var stream = new MemoryStream(); doc.Save(stream); // If the position is not set to '0' then the PDF will be empty. stream.Position = 0; // Close the document. doc.Close(true); stream.Close(); stream.Dispose(); stream.SetLength(0); stream.Capacity = 0; GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect();
IJIrfana Jaffer Sadhik Syncfusion Team April 20, 2023 12:08 PM UTC
After examining the reported issue with the Visual Studio diagnostic tool, we observed that the memory did not decrease even after calling the GC collect. Upon further investigation, we discovered that the memory profiler is not compatible with the ASP.NET platform within Visual Studio. For more information, please consult the following link.