By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,198 Members | 1,721 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,198 IT Pros & Developers. It's quick & easy.

ASP.net NOT Releasing Memory

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
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.