Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 [WTA] VB.Net - Memory comsuming, how to minimized memory used

views
     
TSnaim_mahmood
post Feb 25 2006, 11:15 PM, updated 20y ago

Getting Started
**
Junior Member
105 posts

Joined: Jul 2005


Hi guys.

i'm currently doing a simple clock program nothing much like the one from microsoft "DATE & TIME PROPERTIES"

i just add text clock + calendar, the question is why the program consume memory too much 17MB ! microsoft date & time properties only about 3 ~ 4 mb.


pls give some thought,

thanks.
nameless
post Feb 26 2006, 12:06 AM

On my way
****
Senior Member
623 posts

Joined: Jan 2003


VB.Net application required NET Framework runtime to run ,
just like JAVA with Java runtime which is hungry for memory & CPU usage.

I Guess, that normal for WIN32 .Net Application

Try Imagine , Last time I have been demo complex VB.net app on a client's PC which only has 64MB. T_T
anthony_yio
post Feb 27 2006, 11:24 AM

........
Group Icon
Elite
1,828 posts

Joined: Jan 2003


QUOTE(naim_mahmood @ Feb 25 2006, 11:15 PM)
Hi guys.

i'm currently doing a simple clock program nothing much like the one from microsoft "DATE & TIME PROPERTIES"

i just add text clock + calendar, the question is why the program consume memory too much 17MB ! microsoft date & time properties only about 3 ~ 4 mb.
pls give some thought,

thanks.
*
So, now you guys realize the no need to worry about resource leak do come with price?

wink.gif


Anyway, to improve the situation slightly. You can try

http://msdn.microsoft.com/library/default....enetchapt05.asp




dstl1128
post Feb 27 2006, 05:27 PM

Look at all my stars!!
*******
Senior Member
4,464 posts

Joined: Jan 2003
No matter how you trim it, you basically need a nominal usage of around 10~15MB for that (minimumal) framework run-time, and few MB for your app.



sinx
post Feb 28 2006, 09:11 AM

New Member
*
Junior Member
15 posts

Joined: Aug 2005


Here come with my dirty trick!
Try to call FlushMemory() in every XX seconds then you can see the effect.
Remember, this is DIRTY way. It might NOT REALLY reduce memory usage but i think no harm to try.

CODE
Public Class MemoryManagement

   Private Declare Function SetProcessWorkingSetSize Lib "kernel32.dll" ( _
   ByVal process As IntPtr, _
   ByVal minimumWorkingSetSize As Integer, _
   ByVal maximumWorkingSetSize As Integer) As Integer

   Public Shared Sub FlushMemory()

       GC.Collect()
       GC.WaitForPendingFinalizers()

       If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then
           SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)
       End If

   End Sub
End Class


 

Change to:
| Lo-Fi Version
0.0148sec    0.33    5 queries    GZIP Disabled
Time is now: 24th December 2025 - 04:43 AM