Why does ASP.NET release cache items before the expiration time?

  • Thread starter Sergey via DotNetMonster.com
  • Start date
S

Sergey via DotNetMonster.com

I have Win2003 64bit server with 6 GB or RAM. Windows Task Manager displays
that:

* 0.5 GB are taken by IIS
* 2.0 GB - SQL Server and other applications
* 3 GB - System Cache
* 0.5 GB - available

So it seems like I have plenty of available RAM. However when I add small
data objects to the ASP.NET cache it almost immediately automatically deletes
them, although I set 10 mins experation time and use CacheItemPriority.High.

What could be wrong? The same code works fine on my WindowsXP with 750MB of
RAM.
 
M

Mark Fitzpatrick

Have you also checked to see how often the server is refreshing the
application pool? Have you checked to ensure that the application isnt'
restarting for some reason as well? I had an issue with a virus scanner a
long time ago that would scan my web.config and restart my application every
so often.
 
S

Sergey via DotNetMonster.com

It should not be related to the application pool. I have 1740 minutes as the
recycling period and I do not see any records in the Event Viewer. The
application is not restarting. I have http module that catches AppInit events
and sends me an email notification every time the web application starts.

Actually I tried to add objects to the cache using CacheItemPriority.
NotRemovable instead of CacheItemPriority.High and in this case objects stay
in the cache. This would happen if I do not have enough memory, but according
to Task Manager I have 500MB of available RAM + 3GB of system cache that I
believe should have lower priority than the ASP.NET cache.

BTW does anyone knows whether the ASP.NET cache has really higher priority
than the windows system cache? I have another application running on my
server that is constantly reading a few files per second. There are millions
of these files. Maybe Windows just grabs all the resources for the disk cache
and makes ASP.NET clear its cache?




Mark said:
Have you also checked to see how often the server is refreshing the
application pool? Have you checked to ensure that the application isnt'
restarting for some reason as well? I had an issue with a virus scanner a
long time ago that would scan my web.config and restart my application every
so often.
I have Win2003 64bit server with 6 GB or RAM. Windows Task Manager displays
that:
[quoted text clipped - 13 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top