|
-
Feb 24th, 2008, 03:35 PM
#1
Thread Starter
Fanatic Member
[2005] Memory use and windowstate
Hey all.
I have a program that when i start it up minimized it uses 8,500k of memory
then if i change the state to normal to jumps up to 9,000k but then if i mimize it again i goes down to 1200k of memory.
My question is what is the difference between starting it up minimized and manually troggleing it and how can i emulate that progrmaicly so that hte program only eats up 1 or 2 k of memory.
-
Feb 24th, 2008, 04:07 PM
#2
PowerPoster
Re: [2005] Memory use and windowstate
if you try to limit the amount of memory your application consumes, youre going to come up against nothing but problems. your application is going to take as much memory as it needs to.
-
Feb 25th, 2008, 10:53 AM
#3
Thread Starter
Fanatic Member
Re: [2005] Memory use and windowstate
That didn't answer the question
-
Feb 25th, 2008, 11:00 AM
#4
Re: [2005] Memory use and windowstate
The .NET framework preallocates huge lumps of memory at a time from the operating system and then manages that memory internally.
You are looking at memory usage from the OS side which gives a false reading.
The apparent memory usage goes down when an application is minimized because the .NET memory manager figures the app isn't likely to use that much memory if it isn't active.
There are many better explanations on this site than what I've put above, so have a quick search - and don't worry it is perfectly normal.
-
Feb 25th, 2008, 05:14 PM
#5
Thread Starter
Fanatic Member
Re: [2005] Memory use and windowstate
The reason im sweating this is becuase its going on a terminal server that will have 100 or so users on it.
you can see why 9000k vs 1000k is a big diffrence to internal memory.
the solution i have so far is
(yes this is c#)
c# Code:
this.WindowState = FormWindowState.Minimized; this.WindowState = FormWindowState.Normal; this.WindowState = FormWindowState.Minimized;
I just can't believe that this is the best way to do things
-
Feb 25th, 2008, 05:19 PM
#6
Re: [2005] Memory use and windowstate
I have seen questions about this for at least the last four years, and have never seen an answer that was fundamentally different from what BrailleSchool posted, as unfortunate as that may seem to you. The problem, if you can call it that, is that memory management is out of your hands. The OS giveth and the OS taketh away. The actual memory being used by your program is probably quite a bit smaller than either number, and the OS will reclaim the unused portion as it needs to. Therefore, no matter how you shake and dance, the true usage by your app is probably not something you can materially affect.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|