I have a C# pdf library called PdfSharp which I use to create PDFs. I have a page (print.aspx) which instantiats the class which creates the pdf in the Page_Load() event handler. for some reason when I am running this through IIS, the process for the app pool (w3wp.exe) keeps using more and more memory.
Initially (on first run after a recycle of app pool) the memory usage is about 10mb, then I run print.aspx page and the memory usage goes up to around 70mb (which I assume most of is the .dlls being loaded into memory etc.?) and the pdf is outputted through print.aspx page using a Response.WriteBinary(). When i then refresh the page (i.e. run it again) to create another identical pdf, the memory usage goes up by about 300kb. so its now 70,300kb instead of 70,000kb before the refresh. The outputted pdf is about 190kb when i save it to my pc.
This is happening on our production server and until i added some application pool recycling rules, it was crashing the server after enough requests were made!
I think this must be of a memory leak, but could it be some form of caching? I am running pretty default IIS settings and using .NET 2.0
I am learning more and more about memory management in .net, but until about a week ago, i thought that i didnt need to worry about it, obviously i was wrong....
Any help would be greatly appreciated!