본문 바로가기

오래된 흔적/MEMORY

특정 process가 차지하는 메모리 변화에 관하여..


::: 필요개념 :::

* PSAPI

Process Status Application Programming Interface provides a number of functions that return detailed information about the working set of a process

#include <psapi.h>
set the external link in project setting : psapi.lib

- PSAPI Functions

* Working Set

The working set of a process is the set of pages in the virtual address space of the process that are currently resident in physical memory.

* Working Set Information


Process Working Set

* page

가상 기억 장치를 사용하는 시스템에서 가상 기억 장치와 실제 기억 장치 사이에 매핑이 이루어지는 단위. 즉, 주기억 장치로의 반입, 주기억 장치로부터의 방출 그리고 가상 주소의 변환 등이 모두 하나의 페이지를 단위로 이루어진다. 일반적으로 페이지는 고정 길이를 사용하는 데, 주기억 장치는 보조 기억 장치의 페이지와 같은 크기를 사용한다. ☞ virtual memory 참조

* virtual memory

컴퓨터 시스템에 실제적으로 설치되어 있는 기억 장소보다 커다란 기억 장소를 응용 프로그램에서 사용할 수 있도록 하는 기억 장소 관리 방법. 실제로 컴퓨터 시스템에 설치되어 있는 기억 장소를 물리적 기억 장소(Physical Memory)라고 하는데 컴퓨터 시스템에서 실행되는 응용 프로그램에서는 물리적 기억 장소를 직접 사용하는 것이 아니라 물리적 기억 장소보다 커다란 가상적인 기억 장소를 사용한다. 그리고 응용 프로그램에서 사용하는 가상 기억 장소가 실제로 필요할 때 컴퓨터 시스템에서는 가상 기억 장소에 해당되는 정보를 디스크로부터 읽어와 물리적 기억 장소에 설치한다.


* Process Functions for Debugging


::: Working Set Monitoring 알고리즘 :::

1. InitializeProcessForWsWatch Fuction으로 초기화 시키고..

2. GetWsChanges Function으로 working set에 추가되는 page들에 대한 정보를 얻고..
PSAPI_WS_WATCH_INFORMATION : The structure tells you which pages are in memory, and what caused the system to page them in.

'오래된 흔적 > MEMORY' 카테고리의 다른 글

Visual Leak Detector  (0) 2009.06.26
Process ID 얻기..  (0) 2009.06.10
Windows Vista Kernel 관련 자료  (0) 2009.06.09
메모리가 부족하면 컴퓨터가 느린 것은 왜 그런걸까?  (0) 2009.06.08