According to this question, I want to know if asp.net's system.web.caching.cache is good for me, or I should use database caching?
So, I need to know how much memory is being used by system.Web.caching.cache? But since I am using a shared hosting server, I can't use task manager. Is there any way to determine how much memory is used by system.web.caching.cache using some code?
One fast way to see how many working memory your application use is to direct ask the garbage collection.
and use this literal
<asp:Literal runat="server" ID="txtMemorysUsed" EnableViewState="false" />
But you can get more details using the
PerformanceCounter
, for example you can get how many virtual memory the pools used by this code:You can use all this parameters to get information's for your pool.
for example, this parametres get the cpu load.
reference: http://msdn.microsoft.com/en-us/library/ms972959.aspx
relative: Monitoring ASP.NET application memory from within the application
I have test that on local iis and works.