본문 바로가기
Study/C++

메모리 최적화 함수와 특정프로세의 메모리 사용량 구하기..

by 뿡뿡대마왕 2011. 9. 28.
반응형

메모리 최적화 하는 함수.

BOOL WINAPI EmptyWorkingSet(
  __in  HANDLE hProcess
);

프로세스 핸들만 넣어주면 된다..
작업관리자를 띄어넣고 실행하고 나면 프로세스의 메모리 사용량이 줄어드는 것을 볼 수 있다.

그리고 특정 프로세스의 메모리 사용량을 확인하려면 

BOOL WINAPI GetProcessMemoryInfo(
  __in   HANDLE Process,
  __out  PPROCESS_MEMORY_COUNTERS ppsmemCounters,
  __in   DWORD cb
);

Process
 [in]

A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right and the PROCESS_VM_READ access right. For more information, see Process Security and Access Rights.

Windows Server 2003 and Windows XP/2000:  The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights.
ppsmemCounters [out]

A pointer to the PROCESS_MEMORY_COUNTERS or PROCESS_MEMORY_COUNTERS_EX structure that receives information about the memory usage of the process.

cb [in]

The size of the ppsmemCounters structure, in bytes.


 아오..영어 싫어.ㅠ_ㅠ 아무래도 기본 영문법 책사야겠어...말은 못해도 읽고 해석은 할 줄 알아야지.  


반응형

'Study > C++' 카테고리의 다른 글

문자열 검색 함수들....  (0) 2011.09.28
system()...콘솔 환경에서 도스 명령어 날릴때!!  (0) 2011.09.28
RegQueryValueEx로 값이 구해지지 않는다??  (0) 2011.09.28
Reference(레퍼런스)...  (0) 2011.09.28
new & delete  (0) 2011.09.28

댓글