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 / October 2004

Tip: Looking for answers? Try searching our database.

WinForm Memory Management

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DotNet - 30 Sep 2004 19:21 GMT
When I create a winform app (even with no additional code or controls), it
typically takes 7 - 10Mb on startup.  An app with 3 forms can take 3x that.  
That memory is allocated to the process only until I minimize the window,
which drops it to < 1Mb.  

How can I reclaim this memory through code, similar to how minimize does it?
I do not want the user to have to minimize the form manually or watch the
form minimize then reappear.
Stoitcho Goutsev \(100\) [C# MVP] - 01 Oct 2004 14:42 GMT
When you start .NET application there a more code loaded in the process
beside the lines that you wrote. The process host .NET CLR, framework
libraries.... It allocates memory for the managed heap, etc. Why yout so
worried about the memory consumption? Unless you write programs for small
devices and with nowadays hardware 10M should be out of any concerns.

Signature

Stoitcho Goutsev (100) [C# MVP]

> When I create a winform app (even with no additional code or controls), it
> typically takes 7 - 10Mb on startup.  An app with 3 forms can take 3x
[quoted text clipped - 6 lines]
> I do not want the user to have to minimize the form manually or watch the
> form minimize then reappear.
DotNet - 01 Oct 2004 20:11 GMT
I appreciate your response.

I understand that there are .NET CLR components being loaded on startup.  
But why does so much space get allocated and then freed up on minimize?  I
would then expect returning the windowstate to normal would reallocate the
space, but it does not.

The primary concern is acceptance from the organizations's architecture and
desktop services teams.  They do not want to deploy an application that
appears to be very resource intensive compared to the functionality.  And it
is difficult to explain why the memory is freed up on a minimize, and then
not reallocated on a restore.  They will not accept the explanation that this
is just the way that .NET works.  Is there no method to constrain resource
consumption, or better manage it?

"Stoitcho Goutsev (100) [C# MVP]" wrote:

> When you start .NET application there a more code loaded in the process
> beside the lines that you wrote. The process host .NET CLR, framework
[quoted text clipped - 12 lines]
> > I do not want the user to have to minimize the form manually or watch the
> > form minimize then reappear.

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.