2

I've an application where we store datasets in HttpRuntime.Cache for Select operations ONLY (alltogether ~20MB of data if the dataset is saved as xml).

We migrated to a new Windows 2008 server x64, where IIS site based Output caching was enabled. Our application pool is set to x64 mode as well. All went well, the application was running with some serious load and about ~ 2GB of memory usage.

With no changes to the application, and no additional traffic, the application started to eat up all memory on the server, that is currently 7GB.

I've tried to disable Output caching, but it didn't help at all. The only way to deal with the problem is to recycle the application pool, but this solution results in the loss of all user sessions.

In my understanding, HttpRuntime.Cache items are global for the application pool. We're only Inserting the items to the Cache on the Application Load event, so there should be no changes whatsoever to the cache items.

With disabled output caching and no additional inserts to the Cache, what could cause the unexpected memory growth?

Branislav Abadjimarinov
  • 5,101
  • 3
  • 35
  • 44
balint
  • 3,391
  • 7
  • 41
  • 50
  • Did you check the task manager (performance -> resource monitor) to see what's eating up the memory (so that you are sure that it is not sql that holds the memory)? Is the database running on the same server? Is the memory in use or stand-by? – Ivo Apr 26 '11 at 14:33
  • Hi, the datasets are populated via WebServices, there are no database servers on this setup. The memory should be in use, because it is constantly growing - 5-20MB/s with a 5-12% CPU usage until it reaches the setted 7GB recycle limit. – balint Apr 26 '11 at 14:44

1 Answers1

1

This sounds like a problem with the Large Objects Heap. Since version 1.0 .NET Garbage collector is notorious for failing to collect large objects from memory. The situation has improved with .net versions but especially on high-load servers there are still problems. Check out these articles to get acquainted with the problem:

http://msdn.microsoft.com/en-us/magazine/cc534993.aspx
http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/
http://www.alexatnet.com/content/net-memory-management-and-garbage-collector

You can also try to profile the application memory on your development server to see if the problem will appear there.

lurkerbelow
  • 709
  • 6
  • 13
Branislav Abadjimarinov
  • 5,101
  • 3
  • 35
  • 44