PC Review


Reply
Thread Tools Rate Thread

How can I reduce the memory consumption?

 
 
liubin
Guest
Posts: n/a
 
      30th Apr 2007
I have created a simple program using C#/.NET. It is very small program
without explicit system resources request in the code. However, the memory
consumption is even above 17M(shown in Windows Task Manager), much higher
than 5M of the same one developed with MFC before.

Now I wonder if there is any effective way to optimize .Net program
achieving following two objectives:

1. Reduce system resources consumption of the program created with .NET/C# ?
2. Speed up the program's startup?

Many thanks for your great help!


 
Reply With Quote
 
 
 
 
Egghead
Guest
Posts: n/a
 
      30th Apr 2007
You can use those,

(1) add this after you finish the start up
GC.Collect()
GC.WaitForPendingFinalizers()
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)

(2) use "Ngen"


Do not complain the C#.Net app start up time, wait unit you c the VC++.Net
app
BTW, why do not try VC++.net ?


--
cheers,
RL
"liubin" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have created a simple program using C#/.NET. It is very small program
>without explicit system resources request in the code. However, the memory
>consumption is even above 17M(shown in Windows Task Manager), much higher
>than 5M of the same one developed with MFC before.
>
> Now I wonder if there is any effective way to optimize .Net program
> achieving following two objectives:
>
> 1. Reduce system resources consumption of the program created with .NET/C#
> ?
> 2. Speed up the program's startup?
>
> Many thanks for your great help!
>



 
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
Memory consumption .NET 1.1 Where is the memory before a garbage collection? roger.dunham@talk21.com Microsoft Dot NET 2 21st Jun 2007 10:05 AM
Memory Consumption =?Utf-8?B?U3VuaWwgUGFuZGl0YQ==?= Microsoft Dot NET Framework Forms 3 6th Feb 2007 07:40 PM
Optimizations to Reduce Memory Consumption and Minimize Paging Mike S Microsoft C# .NET 5 16th Jun 2006 04:16 PM
Re: Optimizations to Reduce Memory Consumption and Minimize Paging Marc Gravell Microsoft C# .NET 0 16th Jun 2006 03:40 PM
Dot bet Sql and memory consumption marcel Microsoft C# .NET 3 6th Oct 2003 03:37 PM


Features
 

Advertising
 

Newsgroups
 


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