01-18-2006, 05:12 PM
for Win2000/XP an later
type PROCESS_MEMORY_COUNTERS cb PageFaultCount PeakWorkingSetSize WorkingSetSize QuotaPeakPagedPoolUsage QuotaPagedPoolUsage QuotaPeakNonPagedPoolUsage QuotaNonPagedPoolUsage PagefileUsage PeakPagefileUsage
dll psapi #GetProcessMemoryInfo hProcess PROCESS_MEMORY_COUNTERS*ppsmemCounters cb
int idpr hpr
idpr=GetProcessId("notepad") ;;if GetProcessId does not exist, use GetWindowThreadProcessId(win("Notepad") &idpr)
hpr=OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ 0 idpr); if(!hpr) ret
PROCESS_MEMORY_COUNTERS pm
if(GetProcessMemoryInfo(hpr &pm sizeof(PROCESS_MEMORY_COUNTERS)))
,out "All memory = %i K, currently in RAM = %i K" pm.PagefileUsage/1024 pm.WorkingSetSize/1024
CloseHandle(hpr)