views:

526

answers:

2

I'm being asked to look into a problem that occurs intermittently on a WebServer running my team's application.

Essentially, we have a webservice that does a lookup between codes. If you have Code Type A, you can use it to look up the corresponding Code Type B. Periodically, when memory is running low, when this webservice is called, a null reference exception is being thrown. Essentially, this service loads a lookup file into cache with a dependency on the file, so if the file chages, the cache is reloaded with the new file. The priority on the cache object is set to default. I'm guessing that somewhere in the code, it isn't being verified that the cache object is still there and when memory on the server gets low, that object is dumped causing the error. I'd like to be able to recreate the error and verify before I start digging into this code.

Is there a way in IIS manager (or from the command prompt) to force a running web app to dump it's cache? I would think that this should recreate the condition and therefore recreate the bug. Not to mention, seeing the detail error should lead to the right section of code.

Thanks,

Steve Brouillard

A: 

My gut reaction would be to set the WebMethod's CacheDuration to zero, then back to whatever you want on an ongoing basis. I haven't tried this, but I think this would dump the cache then start it forming again...

ahockley
Thanks for your advice. This doesn't seem to work while in process, but it was certainly worth a shot.
Steve Brouillard
+1  A: 

I found a utility that can be added to ASP.NET apps that will allow you to dynamically manage the cache as a whole or individual cache objects. Thanks to .NET Rocks! and dnrtv.

Here's a link to the tool that I used. This allowed me to clear just the specific objects in question, on the fly, and prove the error.

Thanks to everyone for your help. ASP Alliance Cache Manager.

Steve

Steve Brouillard