부모글 보이기/감추기 AD BLOCK 해제 요청 이 글에는 광고가 많이 들어가 있지 않습니다. adblock을 해제하셔도 글을 읽는데 그다지 부담이 없으니 해제를 부탁드립니다. EmptyWorkingSet Win32 API를 사용하는 C# 예제 그냥... 아래의 질문에 대한 답으로 작성한 간단한 예제입니다. [c#] EmptyWorkingSet 사용 중 에러 ; http://social.msdn.microsoft.com/Forums/ko-KR/6dff23f4-ece9-43a4-8f6b-3528cca5b4c4/c-emptyworkingset-?forum=dotnetko 참고로, 아래의 코드는 자신의 프로세스에 대한 메모리를 조정하는 것이므로 관리자 권한으로 승격된 프로세스가 아니어도 잘 동작합니다. using System; using System.Diagnostics; using System.Runtime.InteropServices; namespace ConsoleApplication1 { class Program { [DllImport("psapi.dll")] public static extern int EmptyWorkingSet(IntPtr hProcess); static void Main(string[] args) { IntPtr processHandle = Process.GetCurrentProcess().Handle; Console.WriteLine("WorkingSet Mem Size: " + Process.GetCurrentProcess().WorkingSet64); Console.ReadLine(); int result = EmptyWorkingSet(processHandle); Console.WriteLine("Result: " + ((result != 0) ? "Success" : "Failed")); Console.WriteLine("WorkingSet Mem Size: " + Process.GetCurrentProcess().WorkingSet64); } } } 예제 코드는 첨부 파일로 넣어두었습니다. [이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.] [다음 글] 오류 유형: 237. Windows Media Player cannot access the file. The file might be in use, you might not have access to the computer where the file is stored, or your proxy settings might not be correct.[이전 글] Windows: 99. INetCache 폴더가 다르게 보이는 이유 [최초 등록일: 8/13/2014] [최종 수정일: 8/14/2014] 이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다. by SeongTae Jeong, mailto:techsharer at outlook.com 비밀번호 댓글 작성자 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 ... NoWriterDateCnt.TitleFile(s) 13779정성태10/22/20245606개발 환경 구성: 729. WSL 2 - Mariner VM 커널 이미지 업데이트 방법13778정성태10/21/20247123C/C++: 181. C/C++ - 소스코드 파일의 인코딩, 바이너리 모듈 상태의 인코딩13777정성태10/20/20245554Windows: 265. Win32 API의 W(유니코드) 버전은 UCS-2일까요? UTF-16 인코딩일까요?13776정성태10/19/20246585C/C++: 180. C++ - 고수준 FILE I/O 함수에서의 Unicode stream 모드(_O_WTEXT, _O_U16TEXT, _O_U8TEXT)113775정성태10/19/20246617개발 환경 구성: 728. 윈도우 환경의 개발자를 위한 UTF-8 환경 설정13774정성태10/18/20246181Linux: 91. Container 환경에서 출력하는 eBPF bpf_get_current_pid_tgid의 pid가 존재하지 않는 이유13773정성태10/18/20245970Linux: 90. pid 네임스페이스 구성으로 본 WSL 2 + docker-desktop13772정성태10/17/20246192Linux: 89. pid 네임스페이스 구성으로 본 WSL 2 배포본의 계층 관계13771정성태10/17/20245933Linux: 88. WSL 2 리눅스 배포본 내에서의 pid 네임스페이스 구성13770정성태10/17/20246397Linux: 87. ps + grep 조합에서 grep 명령어를 사용한 프로세스를 출력에서 제거하는 방법13769정성태10/15/20247516Linux: 86. Golang + bpf2go를 사용한 eBPF 기본 예제113768정성태10/15/20246789C/C++: 179. C++ - _O_WTEXT, _O_U16TEXT, _O_U8TEXT의 Unicode stream 모드213767정성태10/14/20245699오류 유형: 929. bpftrace 수행 시 "ERROR: Could not resolve symbol: /proc/self/exe:BEGIN_trigger"13766정성태10/14/20245174C/C++: 178. C++ - 파일에 대한 Text 모드의 "translated" 동작113765정성태10/12/20246435오류 유형: 928. go build 시 "package maps is not in GOROOT" 오류13764정성태10/11/20247020Linux: 85. Ubuntu - 원하는 golang 버전 설치13763정성태10/11/20245927Linux: 84. WSL / Ubuntu 20.04 - bpftool 설치13762정성태10/11/20246100Linux: 83. WSL / Ubuntu 22.04 - bpftool 설치13761정성태10/11/20245798오류 유형: 927. WSL / Ubuntu - /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found13760정성태10/11/20246927Linux: 82. Ubuntu - clang 최신(stable) 버전 설치13759정성태10/10/20247946C/C++: 177. C++ - 자유 함수(free function) 및 주소 지정 가능한 함수(addressable function) [6]13758정성태10/8/20246634오류 유형: 926. dotnet tools를 sudo로 실행하는 경우 command not found13757정성태10/8/20246931닷넷: 2306. Linux - dotnet tool의 설치 디렉터리가 PATH 환경변수에 자동 등록이 되는 이유13756정성태10/8/20247120오류 유형: 925. ssh로 docker 접근을 할 때 "... malformed HTTP status code ..." 오류 발생13755정성태10/7/20247680닷넷: 2305. C# 13 - (9) 메서드 바인딩의 우선순위를 지정하는 OverloadResolutionPriority 특성 도입 (Overload resolution priority)113754정성태10/4/20246772닷넷: 2304. C# 13 - (8) 부분 메서드 정의를 속성 및 인덱서에도 확대1 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 ...