ASP.net NOT Releasing Memory

M

M.Ob

Hello...

I am having issues with my asp.net apps not releasing memory. The
memory usage for the process w3p.exe continues to grow to it's
allowable limit and does not drop until the app pool is recycled. How
do I get it so that the memory is released when no longer needed? I
have tries setting up memory recycling at a lower limit than the
defaults, but it recycles way too much slowing down the webs.

Here is my setup:
Win 2k3 SBS
IIS 6
SQL Srvr 2000 sp3a

I have a seperate app pool for my .net webs set to recycle every 15
minutes.

Here is a sample data access function that I am using:
/****************************************************************/
public DataTable GetClosedPhysicalInventories()
{
SqlConnection connection = new SqlConnection( connectionString );
SqlCommand command = new SqlCommand(
"ODN_PI_GetClosedPhysicalInventories", connection );

command.CommandType = CommandType.StoredProcedure;

SqlDataAdapter adapter = new SqlDataAdapter();
DataSet ds = new DataSet();

try
{
adapter.SelectCommand = command;
adapter.Fill( ds );
return ds.Tables[0];
}
catch ( System.Data.SqlClient.SqlException sqle )
{
throw new ODN_SupportLibrary.OrderWebDotNetException(
"There was an error retrieving the list of CLOSED PIs.",
sqle.Message.ToString() + "\n\nSQL Error Num: " +
sqle.Number.ToString() +
"\n\nStack Trace (Inner Exception):\n" +
sqle.StackTrace );
}
catch( Exception ex )
{
throw new ODN_SupportLibrary.OrderWebDotNetException(
"There was an error retrieving the list of CLOSED PIs.",
ex.Message.ToString() );
}
finally
{
connection.Close();
}
}
/****************************************************************/

Any help would be greatly appreciated.

M.Ob
 
J

John Saunders

M.Ob said:
Hello...

I am having issues with my asp.net apps not releasing memory. The
memory usage for the process w3p.exe continues to grow to it's
allowable limit and does not drop until the app pool is recycled. How
do I get it so that the memory is released when no longer needed? I
have tries setting up memory recycling at a lower limit than the
defaults, but it recycles way too much slowing down the webs.

Here is my setup:
Win 2k3 SBS
IIS 6
SQL Srvr 2000 sp3a

Have you confirmed that physical memory usage is growing? In particular,
does disk I/O due to paging seem to correspond with the memory size?

It may be that you are seeing the virtual memory, which may or may not
correspond to physical memory usage.
 
S

Steve Drake

You should really call dispose on all objects that implement it, eg the
command data adaptor, you can do this using the using pattern.

We have a few web apps that get used all the time these do not eat memory.

If you are creating lots off LARGE objects then this can cause memory go up
and up as the large object heap doesn't get defragmented.

Steve
 

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

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top