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

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
 
J

Jens Andersen

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
 

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

Top