memory question... I don't think I posted twice, if so sorry....

  • Thread starter Thread starter Anthony Nystrom
  • Start date Start date
A

Anthony Nystrom

When would it be appropriate to call this: Anytime, specifuc events? When is
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
 
Anthony Nystrom said:
When would it be appropriate to call this: Anytime, specifuc events? When is
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
Hi
I can't answer your questions, but here's a conversion of the code in your
post.:
imports System.Runtime.InteropServices
....

<DllImport("kernel32.dll")> _
Public Shared Function SetProcessWorkingSetSize(ByVal proc As IntPtr, ByVal
min As Integer, ByVal max As Integer) As Boolean

End Function

Public Sub ReclaimMemory()

System.GC.Collect()

System.GC.WaitForPendingFinalizers()

SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)

End Sub



Regards,

Jens Andersen
 
Back
Top