Memory Usage and Minimize Windowstate

M

Matthias Kwiedor

Hi!

I have a small ;) application which needs just to load up the Main Form
40MB (there is a IE Instance implementet). After that i managed with own
Memory Managment to need just 10 to 20MB more for the routines.

So i ended with about 60MB at normal state and at working state (running a
routine) with 80 to 90MB - thats relay huge. If a system has just a small
Memory Pool the GC works fine and it needs just 30MBs without any loose in
speed compared to the 90MB Version.

My point is, that if i minimize the app it needs just 2MB which is fine -
but after setting them back to normal state it runs with a max of 20MB
(40MB to max 60MB) less then started and thats what makes me a little bit
confused.

Someone who has a idea how i can simulate this ;) to prevent the lesser
memory usage from the begining?

Maybe some tips in optimizing the Memory usage at a global way! Now it
implement a Dispose Method to each class where i destroy all Constructs and
Vars and at each Method i destroy the Constructs at the end too - or set
them to null or .clear (Hashtable/ArrayList).


Thanx



Matthias
 
T

Thomas Scheidegger [MVP]

Hi Matthias
if i minimize the app it needs just 2MB which is fine -
Someone who has a idea how i can simulate this


at least on Windows 2000+XP this is a feature of the Windows shell,
for all applications, not only for .NET apps.

AFAIK it is just a call to Win32 SetProcessWorkingSetSize

http://support.microsoft.com/?kbid=293215

http://msdn.microsoft.com/library/en-us/dllproc/base/setprocessworkingsetsize.asp

http://www.google.com/groups?selm=#QB7Apv2BHA.2840@tkmsftngp05


Please first understand what happens with this API....


On the other side, try
http://www.gotdotnet.com/Community/...mpleGuid=36a3e666-6877-4c26-b62d-bfd7cb3154ac

http://www.gotdotnet.com/Community/...mpleGuid=3254325d-a4aa-4bb3-aa86-c72d5104ec74
 
M

Matthias Kwiedor

Hi Thomas,

thanks for your answer und this links.

I see that there is / was a bug with large Arrays i use, but with mem
profilers it shows me that i just use 5MB to 6MB of Heap Data - where the
rest is gone may the GUI ... all Cleanup is working nice and the Heap Data
moves back to the standard size after using a larger amount and free them
after that.

The point is if i use the Application and it need 90MB of Memory, than
minimize it (understand it now) and set it back to normal state and work
the same steps i did before it just needs a max of 60MB ! And thats what
makes me a little bit confused, how can a application use 90MB and after
Minimizing it just 30MB less (by doing the same work)?



Matthias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Memory usage 1
Memory usage issues 5
memory usage of .net application 2
Winforms and memory usage 12
Reducing Mem Usage 6
Confused about memory usage. 1
Memory usage bug... 5
CPU usage issues 1

Top