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.

Re: Memory/Leak Tool? by Eric

Eric
Tue May 04 15:11:29 CDT 2004

Plenty of leaks to go around:

http://www.scitech.se/memprofiler/
http://www.automatedqa.com/techpapers/net_allocation_profiler.asp

HTH;
Eric Cadwell
http://www.origincontrols.com



Re: Memory/Leak Tool? by Yechezkal

Yechezkal
Tue May 04 19:55:39 CDT 2004

Are there also tools for these items for the COMPACT Framework?

0. Memory usage and leaks
1. CPU usage (by thread, etc.)
2. Monitor thread states
3. Other system profiling tools


"Eric Cadwell" <ecadwell@ns.insight.com> wrote in message
news:Os2n9PhMEHA.556@tk2msftngp13.phx.gbl...
> Plenty of leaks to go around:
>
> http://www.scitech.se/memprofiler/
> http://www.automatedqa.com/techpapers/net_allocation_profiler.asp
>
> HTH;
> Eric Cadwell
> http://www.origincontrols.com
>
>



Re: Memory/Leak Tool? by Lloyd

Lloyd
Tue May 04 20:20:25 CDT 2004

in the compact framewrok there is hardly memory leak.
but be carefull with:
- listener (anObject.anEvent += a pointer to method of an object which won't
be disposed !)
- static variable (which won't be disposed either !)

regarding tools I don't much .. sorry ...


--
ihookdb
Get your data mobile
http://www.ihookdb.com


"Yechezkal Gutfreund" <sgutfreund@hotmail.com> wrote in message
news:uRToqujMEHA.2388@TK2MSFTNGP09.phx.gbl...
> Are there also tools for these items for the COMPACT Framework?
>
> 0. Memory usage and leaks
> 1. CPU usage (by thread, etc.)
> 2. Monitor thread states
> 3. Other system profiling tools
>
>
> "Eric Cadwell" <ecadwell@ns.insight.com> wrote in message
> news:Os2n9PhMEHA.556@tk2msftngp13.phx.gbl...
> > Plenty of leaks to go around:
> >
> > http://www.scitech.se/memprofiler/
> > http://www.automatedqa.com/techpapers/net_allocation_profiler.asp
> >
> > HTH;
> > Eric Cadwell
> > http://www.origincontrols.com
> >
> >
>
>



Re: Memory/Leak Tool? by andrew_f_martin

andrew_f_martin
Wed May 05 11:36:33 CDT 2004

"Chris Botha" <chris_s_botha@AT_h.o.t.m.a.i.l.com> wrote in message news:<OK3XMLgMEHA.1156@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;
}
}
}

Re: Memory/Leak Tool? by andrew_f_martin

andrew_f_martin
Wed May 05 11:37:45 CDT 2004

"Lloyd Dupont" <net.galador@ld> wrote in message news:<eW1Y47jMEHA.892@TK2MSFTNGP09.phx.gbl>...
> in the compact framewrok there is hardly memory leak.
> but be carefull with:
> - listener (anObject.anEvent += a pointer to method of an object which won't
> be disposed !)
> - static variable (which won't be disposed either !)
>
> regarding tools I don't much .. sorry ...
>
>
> --
> ihookdb
> Get your data mobile
> http://www.ihookdb.com
>
>
> "Yechezkal Gutfreund" <sgutfreund@hotmail.com> wrote in message
> news:uRToqujMEHA.2388@TK2MSFTNGP09.phx.gbl...
> > Are there also tools for these items for the COMPACT Framework?
> >
> > 0. Memory usage and leaks
> > 1. CPU usage (by thread, etc.)
> > 2. Monitor thread states
> > 3. Other system profiling tools
> >
> >
> > "Eric Cadwell" <ecadwell@ns.insight.com> wrote in message
> > news:Os2n9PhMEHA.556@tk2msftngp13.phx.gbl...
> > > Plenty of leaks to go around:
> > >
> > > http://www.scitech.se/memprofiler/
> > > http://www.automatedqa.com/techpapers/net_allocation_profiler.asp
> > >
> > > HTH;
> > > Eric Cadwell
> > > http://www.origincontrols.com
> > >
> > >
> >
> >


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;
}
}
}

Re: Memory/Leak Tool? by Christoph

Christoph
Thu May 06 15:59:08 CDT 2004

.Net Memory Profiler by Scitech might do the trick.

http://www.scitech.se/memprofiler/

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...