473,789 Members | 2,898 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 GetClosedPhysic alInventories()
{
SqlConnection connection = new SqlConnection( connectionStrin g );
SqlCommand command = new SqlCommand(
"ODN_PI_GetClos edPhysicalInven tories", connection );

command.Command Type = CommandType.Sto redProcedure;

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

try
{
adapter.SelectC ommand = command;
adapter.Fill( ds );
return ds.Tables[0];
}
catch ( System.Data.Sql Client.SqlExcep tion sqle )
{
throw new ODN_SupportLibr ary.OrderWebDot NetException(
"There was an error retrieving the list of CLOSED PIs.",
sqle.Message.To String() + "\n\nSQL Error Num: " +
sqle.Number.ToS tring() +
"\n\nStack Trace (Inner Exception):\n" +
sqle.StackTrace );
}
catch( Exception ex )
{
throw new ODN_SupportLibr ary.OrderWebDot NetException(
"There was an error retrieving the list of CLOSED PIs.",
ex.Message.ToSt ring() );
}
finally
{
connection.Clos e();
}
}
/*************** *************** *************** *************** ****/

Any help would be greatly appreciated.

M.Ob
Nov 18 '05 #1
2 2211
"M.Ob" <mo@novastar.ne t> wrote in message
news:c5******** *************** ***@posting.goo gle.com...
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
johnwsaundersii i 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.ne t> wrote in message
news:c5******** *************** ***@posting.goo gle.com...
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 GetClosedPhysic alInventories()
{
SqlConnection connection = new SqlConnection( connectionStrin g );
SqlCommand command = new SqlCommand(
"ODN_PI_GetClos edPhysicalInven tories", connection );

command.Command Type = CommandType.Sto redProcedure;

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

try
{
adapter.SelectC ommand = command;
adapter.Fill( ds );
return ds.Tables[0];
}
catch ( System.Data.Sql Client.SqlExcep tion sqle )
{
throw new ODN_SupportLibr ary.OrderWebDot NetException(
"There was an error retrieving the list of CLOSED PIs.",
sqle.Message.To String() + "\n\nSQL Error Num: " +
sqle.Number.ToS tring() +
"\n\nStack Trace (Inner Exception):\n" +
sqle.StackTrace );
}
catch( Exception ex )
{
throw new ODN_SupportLibr ary.OrderWebDot NetException(
"There was an error retrieving the list of CLOSED PIs.",
ex.Message.ToSt ring() );
}
finally
{
connection.Clos e();
}
}
/*************** *************** *************** *************** ****/

Any help would be greatly appreciated.

M.Ob

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3049
by: lebo | last post by:
Hi I'm trying to understand how Python handles memory usage and dynamic object loading and unloading. Problem to solve? Build a very low memory footprint (non-GUI) Python application for Unix/Windows. Why use Python? End user flexibility. So far it seems that (on Windows): (1) memory increases when you import <module>. Expected behaviour. (2) memory does not release when you del <module>. Why not? Is Python
7
25982
by: trialproduct2004 | last post by:
Hi all I am having application in c# where i am loading one table of database into dataset. My table is of large size. so whenever i am loading that into dataset my memory size is getting increased. So what i want is as soon as i am setting dataset to null, memory should be released. But when i am looking into task manager for memory useage what i am
8
12046
by: Sean | last post by:
I have a service that is pulling alot of records from a SQL Server table in a DataSet. This process takes up alot of memory, which is to be expected. But when the process is finished, I am clearing all the data I thought with: MyDataSet.Tables("MyTable1").Rows.Clear() MyDataSet.Tables("MyTable2").Rows.Clear() MyDataSet.Tables("MyTable3").Rows.Clear() But I'm monitoring the memory the process is doing and this isn't freeing the memory. Is...
5
9192
by: Mark Rae | last post by:
Hi, I'm encountering a strange phenomenon whereby a DataSet object is not releasing its memory when it's being disposed and/or set to Nothing. It is part of a Windows service written in VB.NET which fetches data out of a mySQL database, interrogates each row individually and takes various actions accordingly. It can fetch upwards of 300,000 rows, each of which vary between 1k and 2k in size, making the resulting DataSet object almost...
12
3161
by: iker.arizmendi | last post by:
Is there any way to get Python to release memory back to the C allocator? I'm currently running a script that goes through the following steps: 1) Creates a very large number of Python objects to produce a relatively small data structure that sits in a C extension. The Python objects consume quite a bit of memory. 2) Releases all the Python objects.
3
1569
by: ib | last post by:
ICloneable::Clone returns a new instance of the object being cloned. However, it seems possible that the garbage collector could release this memory before the calling function receives a reference to the memory. If this can occur then it introduces an error that would only occur at random times. Is this really a problem or does .NET take the necessary steps to ensure the memory is first referenced by the calling function before the...
5
3151
by: Ian Boyd | last post by:
Customer is running a load test against a websphere application that uses DB2. While the load test is running the memory usage of DB2 climbs from x up to y. When the load test ends, the memory usage of DB2 returns to x. However, sometimes after running the load test the memory usage does not drop down to x right away; sometimes it takes a few hours. This "problem" exists with their current live version of the software, and the version we...
1
2245
by: amollokhande1 | last post by:
Hi All, We have ASP.Net based content management web application. We are performing lots of XML based operations like setting the innerxml, loading the xml, string replace operations on XML etc. As per my observation during these operations,memory keep on allocating on heap and never release untill Garbage collector gets called by system. I also set all the objects to nothing after its use, but still it is not releasing the memory. Can...
2
2846
by: enggwaqas | last post by:
Hi guys, I have a memory problem in my vb.net application. It's actually a point of sales system, which must be keep running the whole day. The problem is: application is not releasing any memory that it allocates for any resources. When my application starts it loads a form say frmLogin, at this time the memory used by my application is for example 67K. Now when user enters his credentials an MDI form is loaded, causing memory to increase...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.