473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Memory Leak Issue :(

271 100+
Hi,
I have an ASP.net application with c# which uses MS SQL server 2005. I find that the cpu usage of my server reaches 100% when ever i run the application. I was told that i may have memory leak in my application. How can i trace is there are any memory leaks in my application? Note: I am not the programmer of this application. But i have the complete source code as i am doing maintenance and enhancements on this application.
Feb 5 '10 #1
1 1287
tlhintoq
3,525 Expert 2GB
Memory leaks are something that were supposedly going to be a thing of the past with managed code. That didn't happen, but it is better than unmanaged code.

A quick first test. Open up task manager and look at the memory used when you application is not running. Then start the application. Does the memory consumption suddenly jump to 100%, or does it start low and climb steadily?

If it is a leak, meaning that as code runs objects are not being disposed of, then it should rise a little every time it performs a given task.

If it jumps to 100% right off the bat, then maybe a huge array of memory is being re-allocated.

If your application has a set of say... 6 tasks that it routinely performs... then hammer away at one of them. Write a little test app that will just keep hitting it with task#1, see if that causes the problem. Then task#2. and so on. Keeping an eye on the memory used. See if you can at least narrow down the problem to a given task. If they all do it, what methods do they all share?

It really just comes down to old-fashioned examination of the code. Where are you creating objects that aren't being disposed of?

You might also want to check out reviews of the various commercial applications that are supposed to help located such issues. Google should help with that.
Feb 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Newbie | last post by:
We have a web application in AS. It also uses COM+ and SQL Server as back-end. Sometimes the size of the dllhost.exe grows unexpectedly. It is such that we restart our IIS/ PWS. Also there is...
10
by: florian kno | last post by:
hello all! i'm using gcc 3.2 on linux. i have a (self developed) matrix class: class cMatrix { // unneccessary info stripped .... double *data; // matrix data is stored in a heap array ...
14
by: J. Campbell | last post by:
what happens to allocated memory when a program terminates before the memory is released. For example: int main(){ int* array; int a_size = 1000; array = new int; for(int i = 0; i < a_size;...
5
by: Sharon | last post by:
Hi to all. My program starts at about 7000 KB memory consumption. After few hours it gets to over 200 MB. Running GC.Collect() periodically did not help, so it must be a leak. How can i find...
4
by: Don Nell | last post by:
Hello Why is there a memory leak when this code is executed. for(;;) { ManagementScope scope = new ManagementScope(); scope.Options.Username="username"; scope.Options.Password="password";...
23
by: James | last post by:
The following code will create memory leaks!!! using System; using System.Diagnostics; using System.Data; using System.Data.SqlClient; namespace MemoryLeak
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
7
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports...
22
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a...
3
by: not_a_commie | last post by:
The CLR won't garbage collect until it needs to. You should see the memory usage climb for some time before stabilizing. Can you change your declaration to use the 'out' keyword rather than a 'ref'...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.