1. 在全局代码中加入
<DllImport("kernel32.dll")> _
Public Function SetProcessWorkingSetSize(ByVal hProcess As Integer, _
ByVal dwMinimumWorkingSetSize As Integer, _
ByVal dwMaximumWorkingSetSize As Integer) _
As Integer
End Function
<DllImport("kernel32.dll")> _
Public Function GetCurrentProcess() As Integer
End Function
2. 在项目属性的项目事件的SystemIdle
SetProcessWorkingSetSize(GetCurrentProcess, -1, -1)
这样做不是减少了狐表的什么功能,只是将狐表占用的内存转移到了硬盘的虚拟内存空间中.