unbreakable Posted November 4, 2004 Posted November 4, 2004 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. Quote
brentnewbury Posted November 4, 2004 Posted November 4, 2004 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 Quote
Wile Posted November 5, 2004 Posted November 5, 2004 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. Quote Nothing is as illusive as 'the last bug'.
Administrators PlausiblyDamp Posted November 5, 2004 Administrators Posted November 5, 2004 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 http://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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
brentnewbury Posted November 5, 2004 Posted November 5, 2004 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 Quote
HJB417 Posted November 5, 2004 Posted November 5, 2004 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. Quote
unbreakable Posted November 16, 2004 Author Posted November 16, 2004 Thanks HJB417. .NET memory profiler was the one that we were looking for. It worked great. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.