Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Memory Consumption

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sunil Pandita - 05 Feb 2007 07:47 GMT
HI, there,

I am developing the desktop application using VB 6 as well as VB.Net.

I have noticed one significant difference.

A created an empty windows app in VB contsing of a single form and there is
no coding and any control on it.

When  I executed the EXE, it consumed 983KB of memory.

I created the  same type of EXE in VB.net and when I executed I was
astonished to see that it Consumed approx 15 MB of Memory.

I looked very strange to me as from the primary analysis I think it might me
that CLR launched all the necessary DLL's in the memory space of the EXE that
i created like, System.Windows.dll, System.dll etc.

But I just want to know if this is the case then .NET windows applications
are very memory consuming as compared to their VB counterparts.

Could any one please eloberate this issue to me?
Signature

Sunil Pandita
Software Engineer
(OTS Solutions Pvt. Ltd. )

Ciaran O''Donnell - 05 Feb 2007 10:36 GMT
You are correct in your assumption as to the memory consumption. Your app has
loaded the CLR and the FCL dlls for the System, System.Windows.Forms
namespaces and all the others encountered so far.
The benefit of .NET is not reduced memory footprint. There is a cost to a
managed environment, but if you coded all the capability of .NET in VB and
ran that app, the memory footprint would be enormous. You may not have put
controls on your form, but when you did you would be able to use the to put
together client server applications accessing distant databases, remoting
server objects and calling web services, and doing all other kinds of things
that would take you years to code yourself in VB.

Thats the benefit.

Signature

Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com

> HI, there,
>
[quoted text clipped - 18 lines]
>
> Could any one please eloberate this issue to me?
n! - 05 Feb 2007 11:48 GMT
I would suggest the biggest reason for the memory footprint isn't the CLR or
other DLL's loaded. but rather due to how memory is managed by the CLR and
the garbage collector.

The garbage collector has a behaviour that requires a block of memory to be
allocated (well, technically, a couple of memory blocks) and these memory
blocks will expand depending on the behaviour of your application and how
much garbage is collected. The memory footprint of the application (as
viewed in the task manager, at least) will be larger than an unmanaged
application because of these memory pools allocated by the CLR for providing
memory to the application.

Whilst your application may not be allocating that much memory, to ensure
the memory blocks are not reallocated too frequently to adversely affect an
applications performance it is necessary for a memory block of a certain
size to be allocated.

n!
Bob Powell [MVP] - 06 Feb 2007 19:40 GMT
The memory manager will initially attempt to grab a of of space for
itself. Just close your eyes, don't worry about it and trust that the
CLR will manage the memory for you.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> HI, there,
>
[quoted text clipped - 18 lines]
>
> Could any one please eloberate this issue to me?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.