当前位置: 首页>>代码示例>>Python>>正文


Python win32process.GetProcessMemoryInfo方法代码示例

本文整理汇总了Python中win32process.GetProcessMemoryInfo方法的典型用法代码示例。如果您正苦于以下问题:Python win32process.GetProcessMemoryInfo方法的具体用法?Python win32process.GetProcessMemoryInfo怎么用?Python win32process.GetProcessMemoryInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在win32process的用法示例。


在下文中一共展示了win32process.GetProcessMemoryInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: memory

# 需要导入模块: import win32process [as 别名]
# 或者: from win32process import GetProcessMemoryInfo [as 别名]
def memory():
                process_handle = win32api.GetCurrentProcess()
                memory_info = win32process.GetProcessMemoryInfo( process_handle )
                return memory_info['PeakWorkingSetSize'] 
开发者ID:Autodesk,项目名称:arnold-usd,代码行数:6,代码来源:Debug.py

示例2: test_memory_info

# 需要导入模块: import win32process [as 别名]
# 或者: from win32process import GetProcessMemoryInfo [as 别名]
def test_memory_info(self):
        handle = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION,
                                      win32con.FALSE, self.pid)
        self.addCleanup(win32api.CloseHandle, handle)
        sys_value = win32process.GetProcessMemoryInfo(handle)
        psutil_value = psutil.Process(self.pid).memory_info()
        self.assertEqual(
            sys_value['PeakWorkingSetSize'], psutil_value.peak_wset)
        self.assertEqual(
            sys_value['WorkingSetSize'], psutil_value.wset)
        self.assertEqual(
            sys_value['QuotaPeakPagedPoolUsage'], psutil_value.peak_paged_pool)
        self.assertEqual(
            sys_value['QuotaPagedPoolUsage'], psutil_value.paged_pool)
        self.assertEqual(
            sys_value['QuotaPeakNonPagedPoolUsage'],
            psutil_value.peak_nonpaged_pool)
        self.assertEqual(
            sys_value['QuotaNonPagedPoolUsage'], psutil_value.nonpaged_pool)
        self.assertEqual(
            sys_value['PagefileUsage'], psutil_value.pagefile)
        self.assertEqual(
            sys_value['PeakPagefileUsage'], psutil_value.peak_pagefile)

        self.assertEqual(psutil_value.rss, psutil_value.wset)
        self.assertEqual(psutil_value.vms, psutil_value.pagefile) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:28,代码来源:test_windows.py

示例3: update

# 需要导入模块: import win32process [as 别名]
# 或者: from win32process import GetProcessMemoryInfo [as 别名]
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 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:10,代码来源:process.py


注:本文中的win32process.GetProcessMemoryInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。