FYI, that I removed unnecessary information and the sample code might not do anything, but just demonstrate that memory usage will not drop after the the method TestMemory() is complete.
Our application just use part of GdPicture, and we don't want the memory to linger after we're done, or depend on GC to release the image. Using a the following PDF file http://www.testingexperience.com/testingexperience02_10.pdf as an example, there's approx 200MB committed memory that is not released after usage. That's a lot in our environment.
I'm using 8.5.0.1 version of GdPicture. Thanks!
- Code: Select all
public void TestMemory(string fileSpec)
{
var pdf = new GdPicturePDF();
pdf.LoadFromFile(fileSpec, false);
for (var pageNo = 1; pageNo <= pdf.GetPageCount(); pageNo++)
{
pdf.SelectPage(pageNo);
using (var gdImage = new GdPictureImaging())
{
var imageId = pdf.RenderPageToGdPictureImage(200F, false);
gdImage.ReleaseGdPictureImage(imageId);
}
}
pdf.CloseDocument();
}
