469,953 Members | 2,256 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

ASP.net NOT Releasing Memory

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
Nov 18 '05 #1
2 2033
"M.Ob" <mo@novastar.net> wrote in message
news:c5**************************@posting.google.c om...
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.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
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
"M.Ob" <mo@novastar.net> wrote in message
news:c5**************************@posting.google.c om...
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

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by lebo | last post: by
7 posts views Thread by trialproduct2004 | last post: by
5 posts views Thread by Mark Rae | last post: by
12 posts views Thread by iker.arizmendi | last post: by
3 posts views Thread by ib | last post: by
5 posts views Thread by Ian Boyd | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.