PDA

View Full Version : سوال: نحوه بهینه کردن حافظه رم



birtemp
پنج شنبه 10 آذر 1390, 13:28 عصر
سلام.
من چطور میتونم حافظه رم رو فشرده سازی یا همون (Optimiz) کنم.
یه کدی خودم دارم ولی کار نمیکنه.


Declare Function a Lib "Kernel32.dll" (ByVal proccess As IntPtr, ByVal minimumWorkingSetSize As Integer, ByVal maximumWorkingSetSize As Integer) As Integer



Public Sub compmemory()
Try
GC.Collect()
GC.WaitForPendingFinalizers()
If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then
a(Process.GetCurrentProcess().Handle, 1, 1)
Dim mproc As Process() = Process.GetProcessesByName("ApplicationName")
Dim mproc1 As Process
For Each mproc1 In mproc
a(mproc1.Handle, 1, 1)

Next mproc1
End If
Catch ex As Exception
End Try
End Sub