Beispiel #1
0
 def update(self):
     process_handle = GetCurrentProcess()
     meminfo = GetProcessMemoryInfo(process_handle)
     memstatus = GlobalMemoryStatusEx()
     self.vsz = memstatus['TotalVirtual'] - memstatus['AvailVirtual']
     self.rss = meminfo['WorkingSetSize']
     self.pagefaults = meminfo['PageFaultCount']
     return True
Beispiel #2
0
 def _get_memory_info(self, process_handle):
     return GetProcessMemoryInfo(process_handle)
Beispiel #3
0
 def get_working_set_size():
     return int(
         GetProcessMemoryInfo(
             OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,
                         0, GetCurrentProcessId()))["WorkingSetSize"] /
         1048576.0)
Beispiel #4
0
def vmsize():
    handle = get_win32_handle(getpid())
    m = GetProcessMemoryInfo(handle)
    return m["WorkingSetSize"]