Private Sub Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AddHandler Application.Idle, AddressOf FlushMemory
End Sub
Private Sub FlushMemory()
If System.Environment.OSVersion.Platform = PlatformID.Win32NT Then
SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1)
End If
End Sub
<DllImport("kernel32.dll")> _
Public Shared Function SetProcessWorkingSetSize(ByVal handle As IntPtr, ByVal minimumWorkingSetSize As Integer, ByVal maximumWorkingSetSize As Integer) As Boolean
End Function