smart when is not... Also, can someone give me a complete example of doing
this in vb.net? Please define the hprocess and IntPtr proc and int min and
int max.... Say my app runs in an instance named appnew, what would be the
call?
Thanks in advance.....
Anthony Nystrom
Basically, you want to call the Win32 api function
SetProcessWorkingSetSize(hProcess, -1, -1).
If you're not familiar with P/Invoke, here's some code....
[DllImport("kernel32.dll")]
public static extern bool SetProcessWorkingSetSize( IntPtr proc, int min,
int max );
...
...
public static void ReclaimMemory()
{
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
SetProcessWorkingSetSize( Process.GetCurrentProcess().Handle, -1, -1 );
}