Forced GC.Collect in Asp.net CMS website

Anaensenivy

New Member
This is the situationI am working on a Content Management System where we have two parts first is admin side from where admin users can fill contents and second is user side from where users can see the content provided by admin from the admin panel.If a user is browsing my website he only visits those pages which do only one thing, They pull the content from database according to the page and shows that content to the user.The problem is when I run my website in my local IIS and browse it for some time and track the memory usage by the IIS worker process (w3wp.exe) is shows 109,292 K at peak usage.So to solve this I put this code in my global.asax file\[code\]void Application_EndRequest(object sender, EventArgs e){ GC.Collect(0, GCCollectionMode.Forced); GC.Collect(1, GCCollectionMode.Forced); GC.Collect(2, GCCollectionMode.Forced);}\[/code\]After this the usage drop to 75,980 K at peak usage.The question is am I doing right thing here ? because I read many articles which say that I should not perform this \[code\]GC.Collect\[/code\].UpdateAt real environment this is the situation whithout any \[code\]GC.Collect()\[/code\]
tQXkb.png
 
Back
Top