[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Elizabeth Harmon

5/13/2005 11:14:00 AM

I recently had a System Out of Memory exception On a windows 200 server
where my .Net App Resides. I checked thru my code and can't seem to find
anything like an infinite loop or objects that are not set to nothing when
they are done being used. Is there some way to examine how much Cache i use
when i insert items into Cache? I do cache between pages using my custom
objects, they dont hold alot of data generally One recordsets worth of data
not more than a few rows.

Is there some way to poll the server and ask what's in Cache and what size
is it? I set expire to 30 mins because of user need
(They could walk away for a few minutes at a time)

Any Help is greatly appreciated
TIA


2 Answers

Alvin Bruney [ASP.NET MVP]

5/14/2005 12:40:00 AM

0

No, there isn''t. You can use some perfmon counters but they don''t really
give you a direct way of measuring memory utilization. In any case, out of
memory issues typically have to do with large blocks of memory requests that
overwhelm the run-time. Search your code for particularly large datasets

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"Elizabeth Harmon" <Jdavies@helthchoice.com> wrote in message
news:O1TfQz6VFHA.2960@TK2MSFTNGP15.phx.gbl...
>I recently had a System Out of Memory exception On a windows 200 server
>where my .Net App Resides. I checked thru my code and can''t seem to find
>anything like an infinite loop or objects that are not set to nothing when
>they are done being used. Is there some way to examine how much Cache i use
>when i insert items into Cache? I do cache between pages using my custom
>objects, they dont hold alot of data generally One recordsets worth of data
>not more than a few rows.
>
> Is there some way to poll the server and ask what''s in Cache and what size
> is it? I set expire to 30 mins because of user need
> (They could walk away for a few minutes at a time)
>
> Any Help is greatly appreciated
> TIA
>


gabe garza

5/14/2005 7:37:00 PM

0

Put this in a ASPX page in your web application, call it monitorcache.aspx,
for example.
NOTE: If this page is sensitive you''ll probably want to name it something
where nobody can access it (38fjfediwei239.aspx) or put it in Forms
Authentication so only certian people can access it. That''s up to you.

private void Page_Load(object sender, System.EventArgs e)
{
System.Collections.IDictionaryEnumerator ide = Page.Cache.GetEnumerator();
string skey;
object svalue;

// Go thru all your items in cache for the web application that this ASPX
page is in.
while(true == ide.MoveNext())
{
skey = ide.Key.ToString();
svalue = Cache[skey];

// Since the svalue object is unique to your web application you''ll just
have to add
// additional code to check the type and cast to your appropriate object
type
// to read and check your casted object for values.
// As in for example, how many records are in a cached recordset, etc...

// Since you have the key from cache, you can delete it from cache as
well.
}

}

This does work, any questions and I''ll post a C# example at my website.