如何获取可用的虚拟内存的最大值?

linhf 2005-03-08 03:24:53
我发现我设置的虚拟内存为 256~512M ,可是实际上程序用的虚拟内存要比512M大很多。
...全文
124 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
linhf 2005-03-14
  • 打赏
  • 举报
回复
linhf 2005-03-09
  • 打赏
  • 举报
回复
没有人知道吗??
adamx 2005-03-08
  • 打赏
  • 举报
回复
gz
linhf 2005-03-08
  • 打赏
  • 举报
回复
我需要可用的最大的页文件大小,因为当页文件使用到一定程度时,Windows会自动对他进行扩充,直到不能再扩充为止。 而GlobalMemoryStatus 函数取出来的 dwTotalPageFile (Total possible size, in bytes, of the paging file. Note that this number does not represent the actual physical size of the paging file on disk. ) 不能代表整个实际物理尺寸的页文件大小。
可能是我提问时没有说清楚,在这里更正一下。
老夏Max 2005-03-08
  • 打赏
  • 举报
回复
楼上正解
MEMORYSTATUS mem_stat;
GlobalMemoryStatus(&mem_stat);

m_strTotalMemory.Format("%d KB",mem_stat.dwTotalPhys/1024);
m_strFreeMemory.Format("%d KB",mem_stat.dwAvailPhys /1024);
m_strMemoryLoad.Format("%d %%",mem_stat.dwMemoryLoad );
m_strVirtualMemory.Format("%d KB",mem_stat.dwTotalVirtual/1024);
oyljerry 2005-03-08
  • 打赏
  • 举报
回复
GlobeMemoryStatus

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧