Visual Basic Tutorial: Clear the memory Cache

Опубликовано: 06 Февраль 2010
на канале: AfaoMAX
43,729
129

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


На этой странице сайта вы можете посмотреть видео онлайн Visual Basic Tutorial: Clear the memory Cache длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь AfaoMAX 06 Февраль 2010, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 43,729 раз и оно понравилось 129 зрителям. Приятного просмотра!