我知道如何使用 GlobalMemoryStatus( ) 和 GlobalMemoryStatusEx( ) 获取总 RAM,但如何使用 C 编程获取 Windows 上的总交换空间大小?
最佳答案
有关获取页面文件使用和限制的信息在 MEMORYSTATUSEX structure 的文档中.
ullTotalPageFile
The current committed memory limit for the system or the current process, whichever is smaller, in bytes. To get the system-wide committed memory limit, call GetPerformanceInfo.
ullAvailPageFile
The maximum amount of memory the current process can commit, in bytes. This value is equal to or smaller than the system-wide available commit value. To calculate the system-wide available commit value, call GetPerformanceInfo and subtract the value of CommitTotal from the value of CommitLimit.
GetPerformanceInfo填充 PERFORMANCE_INFORMATION结构,文档列出了它包含的所有字段。
MSDN 也有一个名为 Memory Performance Information 的概述。 .
关于c - 在 Windows 上获取 C 中的总交换大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27971475/