Memory Issue

unbreakable

Newcomer
Joined
Oct 20, 2004
Messages
8
Guys,
We are looking at using some third party controls for our applications. But before we use them for our applications, we wanted to make sure that they work fine as far as memory is concerned. So here is what I want to do.
There is a third party control called 'Ultragrid' which is same as the 'wingrid' (except it does a lot more). I am planning to write an application with 'Ultragrid' and then the same application with 'wingrid' and finally I want to see how the two applications perform with regrads to memory.

Is there a way in C# to log the memory usage for the applications? I hope you guys understand my question. If not I am can explain more.

Any suggestions,advice or comments will be greatly appreciated.
Thanks,
Unbreakable.
 
Hiya unbreakable,

I don't know of any way to log or report memory consumption, but you can use Tracing and and a few other tools to help you diagnose performance bottlenecks.

When I get home, I'll try to remember to paraphrase a chapter out of Developing Windows-Based Application (with Visual Basic .NET and Visual C#) which is part of the MCSD .NET Core Requirements set. This chapter tells you the techniques to diagnose performance bottle-necks.


Hope this helps :D

Brent Newbury
 
I think it is very hard to measure memory usage in .NET as you don't have control over the destruction of objects (and subsequent release of memory) due to the .Net managed environment.
 
You can always use Window's Performance monitor to get at certain statistics for your application or within code you can look at things like Environment.WorkingSet or diagnostics.Process.GetCurrentProcess() to get at other properties.

I would also go to www.sysinternals.com and download their Process Explorer tool as this can reveal a lot more about what is goin gon in terms of Memory, JIT, Garbage Collection etc.

However as Wile said Memory usage can be a vague subject under .Net due to how Garbage Collection works, running the same application on differently configured machines can mean drastically different memory usage patterns.
 
Hiya unbreakable,

Here is a small section out of the Developing Windows-Based Applications using Visual Basic.NET and Visual C# (Microsoft Press)
Measuring Performance
Windows 2000 and Windows XP include a utility named perfmon.exe that can be used to monitor a wide variety of performance-related issues. You can use this utility to view performance data graphically or to write data to log files.

You can also use Trace statements to monitor application execution. Emitted Trace statements can be used to pinpoint your application’s execution at run time. Cross-referencing this information with performance data allows you narrow down the location of bottlenecks in your code.

Hope this helps :D


Brent Newbury
 
unbreakable said:
Guys,
We are looking at using some third party controls for our applications. But before we use them for our applications, we wanted to make sure that they work fine as far as memory is concerned. So here is what I want to do.
There is a third party control called 'Ultragrid' which is same as the 'wingrid' (except it does a lot more). I am planning to write an application with 'Ultragrid' and then the same application with 'wingrid' and finally I want to see how the two applications perform with regrads to memory.

Is there a way in C# to log the memory usage for the applications? I hope you guys understand my question. If not I am can explain more.

Any suggestions,advice or comments will be greatly appreciated.
Thanks,
Unbreakable.


you'd probably want a profiler. I use 2. the scitech .net memory profiler and windbg. windg is better because it can attach to an already running process, where as, the scitech profiler must start the process. Windb can also analyze dump files which is good for irreproducible problems.
 
Back
Top