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