最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

windows - How to collect peak working set usage statistics in a time period for the current process? - Stack Overflow

programmeradmin5浏览0评论

The PROCESS_MEMORY_COUNTERS struct returned by GetProcessMemoryInfo contains several values relative to the peak memory usage from the start of the process.

Is it possible to use other functions to collect similar information in a specified time period (and not for the entire lifetime of the process)?

I can think of two ways but both are imperfect:

  • Run a thread that calls GetProcessMemoryInfo repeatedly. This will give approximate results but might miss very transient allocations-deallocations between two calls.
  • Use InitializeProcessForWsWatch, call GetWsChanges and sum the memory of all the pages that have been added... but where are the pages that are no longer used? And what is the impact on performance?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论