Hi,
I seem to be getting quite a lot of leaked memory, which i believe is to do with the way the Fonts objects work within PdfSharp. I realise this topic has been touched on previously, but after reading said topics and trying the garbage collection ideas they present, I still cant get the memory leaks to go away?
I am calling:
Code:
GC.Collect();
GC.WaitForPendingFinalizers();
in quite a few places (such as at the end of the function where the Document is rendered to the PDFDocument object, and the function where i write the memorystream returned by myPdfDoc.Save()) but i still get leaks?
I have been analysing the memory usage in a tool called "ANTS Memory Profiler v6.0" and in each of my print projects, least some memory is being leaked (but is different each time) - most, if not all the leaked memory is in byte[] objects, which are references like this:
byte[] > PdfSharp.Fonts.TrueType.TrueTypeDescriptor > System.Collections.Hashtable+bucket > System.Collections.Hashtable > PdfSharp.Fonts.TrueType.FontDescriptiorStock > FontDescriptorStock.Global
I believe that this memory leak is causing IIS to crash sometimes as the leaked memory gets more and more, which is obviously not a good thing.
Hopefully someone will be able to shed some light on why this might be occurring and how i could fix it.
Thanks
Mike
p.s I think its v1.20 of PdfSharp i am using and I cant really upgrade as this is an existing product which have been "live" for some time.