473,406 Members | 2,404 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,406 software developers and data experts.

Memory/Leak Tool?

I have a Windows app (it will be promoted to a Service once this problem is
sorted out) that cyclically, every minute, connects to five SQL Servers over
the WAN, extract data and insert the data in a local SQL Server, using the
OLEDB provider. Every cycle I create one local connection and five remote
connections, do the stuff, close the connections and dispose everything that
has a Dispose method (OleDbConnection, OleDbDataAdapter and OleDbCommand).
After running overnight the performance degrades and if I examine the
Private Bytes of the process (using Performance Monitor, the way we looked
for memory leaks before DOTNET in C++, but should still be valid), it goes
up from approx. 1.3 MB to over 2 MB.
I've been using DOTNET from the first Beta and never thought I'd say this,
but I suspect a leak.
Is there a method/tool that will show me the type of DOTNET objects being
leaked, or give me some indication of where to look for the problem?

Thanks.
Nov 20 '05 #1
3 1713
* "Chris Botha" <chris_s_botha@AT_h.o.t.m.a.i.l.com> scripsit:
Is there a method/tool that will show me the type of DOTNET objects being
leaked, or give me some indication of where to look for the problem?


Memory Profiler:

<URL:http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=3254325d-a4aa-4bb3-aa86-c72d5104ec74>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
"Chris Botha" <chris_s_botha@AT_h.o.t.m.a.i.l.com> wrote in message news:<OK**************@TK2MSFTNGP09.phx.gbl>...
I have a Windows app (it will be promoted to a Service once this problem is
sorted out) that cyclically, every minute, connects to five SQL Servers over
the WAN, extract data and insert the data in a local SQL Server, using the
OLEDB provider. Every cycle I create one local connection and five remote
connections, do the stuff, close the connections and dispose everything that
has a Dispose method (OleDbConnection, OleDbDataAdapter and OleDbCommand).
After running overnight the performance degrades and if I examine the
Private Bytes of the process (using Performance Monitor, the way we looked
for memory leaks before DOTNET in C++, but should still be valid), it goes
up from approx. 1.3 MB to over 2 MB.
I've been using DOTNET from the first Beta and never thought I'd say this,
but I suspect a leak.
Is there a method/tool that will show me the type of DOTNET objects being
leaked, or give me some indication of where to look for the problem?

Thanks.


This is how we do it. We had code that called a dll written in native
code. We were able to map out the memory leak pretty quickly.

-a
using System;
using System.Runtime.InteropServices;
using System.IO;

namespace MemoryCheck
{
public class Memory
{
public Memory()
{
}

private struct MEMORYSTATUS
{
public Int32 dwLength;
public Int32 dwMemoryLoad;
public Int32 dwTotalPhys;
public Int32 dwAvailPhys;
public Int32 dwTotalPageFile;
public Int32 dwAvailPageFile;
public Int32 dwTotalVirtual;
public Int32 dwAvailVirtual;
}

[DllImportAttribute("coredll.dll")]
private static extern void GlobalMemoryStatus(ref MEMORYSTATUS lp);

private static string getMemInfo()
{
MEMORYSTATUS ms=new MEMORYSTATUS();
GlobalMemoryStatus(ref ms);
return "\r\n" + DateTime.Now.ToString() +
"," + "dwMemoryLoad:" +
"," + ms.dwMemoryLoad +
"," + "dwTotalPhys:" +
"," + ms.dwTotalPhys+
"," + "dwAvailPhys:" +
"," + ms.dwAvailPhys +
"," + "dwTotalVirtual:" +
"," + ms.dwTotalVirtual +
"," + "dwAvailVirtual:" +
"," + ms.dwAvailVirtual + "\r\n";
}

public static void WriteMemory()
{
System.IO.StreamWriter sr = new StreamWriter(@"\test.txt", true);
sr.WriteLine(getMemInfo());
sr.Close();

return;
}
}
}
Nov 20 '05 #4

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

Similar topics

4
by: Morten Aune Lyrstad | last post by:
Ok, now I'm officially confused. I have a large project going, which uses a win32 ui library I am developing myself. And I'm getting weird memory leaks. I don't know if I can explain what is going...
5
by: iceColdFire | last post by:
Hi, I am writing some hybrid application s using C/C++ modules together....Here I have created and used a lot of malloc(...) and new(...) operators. I am interested in checking on the...
17
by: José Joye | last post by:
Hi, I have implemented a Service that is responsible for getting messages from a MS MQ located on a remote machine. I'm getting memory leak from time to time (???). In some situation, it is...
6
by: Mike | last post by:
..NET 1.1 Hi. My C# .NET application has a memory leak - if I leave it running for hours then the system ends up using 500MB+ of virtual memory, which is released immediately when I close the...
6
by: Tina | last post by:
My asp.net app that ran fine on my dev boxes is having problems at my web hoster who is running IIS 6. I'm getting Out of Memory exceptoions. When my web hoster bounces my app, the problem goes...
9
by: Anton | last post by:
{Willy Skjveland} Hi, how can I trace a Memory leak in aspnet_wp.exe? {Rheena} One moment please while I search it for you. It may take me a few moments {Willy Skjveland} I need to find out...
13
by: Boni | last post by:
I use 3-d party component. In this component I must pass a reference to my object. The problem is that this component has an ugly bug.When this component is disposed, it incorrectly don't delete...
30
by: MAG1301 | last post by:
I've detected memory leaks in our huge .NET 1.1 C# application but couldn't localize them directly. So I've reduced the code to the following console application: using System; using System.IO;...
8
by: vidya.bhagwath | last post by:
Hello Experts, I am using std::string object as a member variable in one of the my class. The same class member function operates on the std::string object and it appends some string to that...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.