Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Declare Function:
- SetProcessWorkingSetSize Lib "kernel32.dll" (ByVal process As IntPtr, ByVal minimumWorkingSetSize As Integer, ByVal maximumWorkingSetSize As Integer) As Integer
- Flush Code:
- Public Sub FlushMemory()
- Try GC.Collect()
- GC.WaitForPendingFinalizers()
- If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then
- SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)
- Dim myProcesses As Process() = Process.GetProcessesByName("ApplicationName")
- Dim myProcess As Process
- Dim ProcessInfo As Process
- For Each myProcess In myProcesses
- SetProcessWorkingSetSize(myProcess.Handle, -1, -1) Next myProcess
- End If Catch ex As Exception End Try End Sub
- Code found: https://www.youtube.com/watch?v=-fPY7ecWPUA#t=282
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement