A tutorial on how you can clear your application memory cache, so it can run faster, and lower the CPU usage.
Go to http://afaomax.krylic.net for more tutorials.
You can download the source code for this application at:
http://afaomax.krylic.net/source/clea...
The code used in the program:
Declaration:
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
On this page of the site you can watch the video online Visual Basic Tutorial: Clear the memory Cache with a duration of hours minute second in good quality, which was uploaded by the user AfaoMAX 06 February 2010, share the link with friends and acquaintances, this video has already been watched 43,729 times on youtube and it was liked by 129 viewers. Enjoy your viewing!