[code C#]
using System.Runtime.InteropServices;
[DllImportAttribute("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize);
public static void FlushMemory() {
GC.Collect();
GC.WaitForPendingFinalizers();
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
}
}
[/code]
출처 : http://takeone.pe.kr/category/General%20Dev./C%23%20Application
원본 : http://www.gosu.net/GosuWeb/ArticleMSView.aspx?ArticleCode=342
using System.Runtime.InteropServices;
[DllImportAttribute("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize);
public static void FlushMemory() {
GC.Collect();
GC.WaitForPendingFinalizers();
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
}
}
[/code]
출처 : http://takeone.pe.kr/category/General%20Dev./C%23%20Application
원본 : http://www.gosu.net/GosuWeb/ArticleMSView.aspx?ArticleCode=342
'IT > Dot Net' 카테고리의 다른 글
[펌]ClickOnce - Uninstall (0) | 2008.06.06 |
---|---|
[펌]ClickOnce - 바탕화면 바로가기 (0) | 2008.06.06 |
XAML 관련링크 (0) | 2008.05.22 |
Visual Studio 2008과 .NET Framework 3.5의 새 기능 Link들 (0) | 2008.03.03 |
닷넷프레임웍 소스 코드 디버깅 설정 방법 (0) | 2008.01.29 |