Minimizing and Memory

  • Thread starter Thread starter Evan
  • Start date Start date
E

Evan

I noticed that when I Minimize the Form of a WinForms application that the
memory used drops dramtically.

When the Form is restored, the memory usage increases, but not to where it
was.

I would like to duplicate this memory purging myself. Is there a way? I
don't think it's by using GC.Collect() because when I try that, I do not
get the same result.

What is the answer?

Cheers,
Evan
 
I got this form somewhere of other.
Private Declare Function SetProcessWorkingSetSize Lib "kernel32.dll" (

ByVal hProcess As IntPtr, _

ByVal dwMinimumWorkingSetSize As Int32, _

ByVal dwMaximumWorkingSetSize As Int32_

) As Int32

Public Function SaveMemory() As Int32

Return _

SetProcessWorkingSetSize( _

Diagnostics.Process.GetCurrentProcess.Handle, _

-1, _

-1 _

)

End Sub
 
Hello,

Evan said:
I noticed that when I Minimize the Form of a WinForms application that
the memory used drops dramtically.

This is by design (other windows applications show this phenomenon too)

Regards,
Herfried K. Wagner
 
Back
Top