PC Review


Reply
Thread Tools Rate Thread

CLR Profiler Question

 
 
Rohit
Guest
Posts: n/a
 
      28th Jan 2008
I am using the CLR Profiler to investigate the memory efficiency of my .NET
applications; however, I am puzzled as to the memory allocation size that the
tool reports for my applications.

I am profiling 2 applications: (1) a simple app that has 1 button which when
pressed displays the string "Hello World!" in a messagebox, and (2) a
slightly more complex application which populates a database with data from a
remote machine and then displays some of the data in a datagrid control.

This is what the CLR Profiler says is the memory utilization for the two
applications:

(1) Hello World app: 141K (total) / 141K (final)
(2) Database app: 1.8 M (total) / 870K (final)

The problem is that when I use task manager to check how much memory both
apps are using, I get a size that is much larger than what the profiler is
saying. In particular:

(1) Hello World app: 13 MB
(2) Database app: 21 MB

I do know that some of the difference is the memory used by the .NET
framework itself, but if you do math, you will find that the .NET framework
takes up less memory for the hello world app than it does for the database
app. This is the very thing that I am confused about.

Can somebody please explain this?
 
Reply With Quote
 
 
 
 
forever.zet@gmail.com
Guest
Posts: n/a
 
      28th Jan 2008
On Jan 28, 10:24*am, Rohit <Ro...@discussions.microsoft.com> wrote:
> I am using the CLR Profiler to investigate the memory efficiency of my .NET
> applications; however, I am puzzled as to the memory allocation size that the
> tool reports for my applications.
>
> I am profiling 2 applications: (1) a simple app that has 1 button which when
> pressed displays the string "Hello World!" in a messagebox, and (2) a
> slightly more complex application which populates a database with data from a
> remote machine and then displays some of the data in a datagrid control.
>
> This is what the CLR Profiler says is the memory utilization for the two
> applications:
>
> (1) Hello World app: 141K (total) / 141K (final)
> (2) Database app: 1.8 M (total) / 870K (final)
>
> The problem is that when I use task manager to check how much memory both
> apps are using, I get a size that is much larger than what the profiler is
> saying. *In particular:
>
> (1) Hello World app: 13 MB
> (2) Database app: 21 MB
>
> I do know that some of the difference is the memory used by the .NET
> framework itself, but if you do math, you will find that the .NET framework
> takes up less memory for the hello world app than it does for the database
> app. *This is the very thing that I am confused about.
>
> Can somebody please explain this?


Hi,

I think that's because CLR allocates memory in chunks (several(many)
MB in size), so profiler shows memory used by the application, and
Task Manager shows total memory including memory reserved by CLR for
"future use".

Thanks,
Sergey
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.NET profiler almurph@altavista.com Microsoft VB .NET 3 25th Jan 2006 08:06 PM
Profiler =?Utf-8?B?VHlsZXIgTGFpbmc=?= Microsoft Dot NET Compact Framework 1 9th Oct 2005 07:26 PM
ASP.NET MEM profiler Anders K. Jacobsen [DK] Microsoft ASP .NET 0 7th Jun 2005 10:58 PM
Question on Profiler Bhargavan Microsoft C# .NET 1 24th Feb 2005 10:53 PM
Profiler for C++ in 7.1 Bailey Microsoft VC .NET 2 15th Dec 2003 06:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:52 AM.