Question

Locked

Our ASP.NET 2 web app running on IIS 6 is throwing OutOfMemory Error

By dbasileconsulting ·
Our applications stores large CAD files in an SQL 2005 database field VARBIN(max). A few of these documents are in excess of 100MB in size. Our application throws an "OutOfMemory" exception when attemption to download or upload these large CAD files.
This is government data, so we put the drawings into a database field for security purposes.
The webserver is running 32bit Win2003 and IIS6, it has 2GB RAM.The sqlserver is running 32bit Win2003 and MS SQL 2005, it has 2GB RAM.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Did you check in Task Manager

by Darryl~ Moderator In reply to Our ASP.NET 2 web app run ...

To see how much RAM is being used when you get the error? I'd check both the SQL server & the web server.

It's not much, but it's somewhere to start.

Collapse -

OOM is exactly that.

by Tony Hopkinson In reply to Our ASP.NET 2 web app run ...

SQL Server by default will grab every bit of memory it can, you could put a limit on it.

You could move to a seperate webserver and database server, but my initial thought is there's something wrong with the code.

That 100M for the stream has to be contiguous for instance...

When you are creating the streams to up and download, are they wrapped in a using clause?

Another thing you might try is kicking the GC into a clean up before you streame out of into the DB.

But really you need to test bed and monitor the performance to see what's going on for a permanent solution.

PS if you believed the MS guff about no longer having to manage memory anymore, your problem could be somewhere completely different, get some profiling going.

The code to put the file into and get out of the database might help us give you some more help.

Collapse -

Resolutions

by dbasileconsulting In reply to Our ASP.NET 2 web app run ...

1. We will limit the size of documents that will be stored in the DB.
2. After closely monitoring the Task Mgr for RAM usage, we setup IIS to recycle worker processes based on memory usage, and created a server garden by allowing up to 5 worker processes.
3. We modified our ASP.NET Config File (web.config) to use SQLServer to hold our session states. This keeps our user's credentials when the processes recycle.

Thanks for all your help.
db

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums