tags:

views:

117

answers:

3

I have hosted some 5 applications on IIS in my server.

After sometimes I am getting System.OutOfMemoryException error due to out of memory in ASP.NET Temp Folder.

Is there any way to clear it automatically or any setting for this.

+1  A: 

I doubt you're getting an OutOfMemoryException because a temp folder is full. I can see other types of exceptions being thrown for a full drive, just not OutOfMemoryException. I think you're looking in the wrong place.

Dave Markle
but when i clear the ASP.NET temp folder it gets running.
santose
When you clear the ASP.NET temp folder, you may be triggering something that implicitly restarts your application and clears up the error that way. It's the same thing that would happen if you had made an edit to web.config -- it's not that web.config was the source of your problem, it's that when you edit it, your application restarts.
Dave Markle
+1  A: 

System.OutOfMemoryException isn't due to your temp folder, this happens when .Net can't allocate memory.

You may want to look at MSDN Troubleshooting topics for this.

Nick Craver
A: 

OutOfMemoryException isn't thrown because your temp directory is filling up. However, if some part of your code is reading the list of files, it may trigger the exception. This is not due to the directory filling up, but because the required data structure cannot be allocated by the runtime.

Brian Rasmussen