谁知道如何获取系统未分页内存池大小

解决方案 »

  1.   

    VOID GlobalMemoryStatus(
      LPMEMORYSTATUS lpBuffer   // pointer to the memory status structure
    );
      

  2.   

    Oh ! Late , agree with enoloo :)BOOL GlobalMemoryStatusEx(
      LPMEMORYSTATUSEX lpBuffer   // memory status structure
    );
    typedef struct _MEMORYSTATUSEX {
      DWORD dwLength; 
      DWORD dwMemoryLoad; 
      DWORDLONG ullTotalPhys; 
      DWORDLONG ullAvailPhys; 
      DWORDLONG ullTotalPageFile; 
      DWORDLONG ullAvailPageFile; 
      DWORDLONG ullTotalVirtual; 
      DWORDLONG ullAvailVirtual; 
      DWORDLONG ullAvailExtendedVirtual;
    } MEMORYSTATUSEX, *LPMEMORYSTATUSEX; sample in msdn :#define _WIN32_WINNT 0x0500#include <windows.h>// Use to change the divisor from Kb to Mb.#define DIV 1024
    // #define DIV 1char *divisor = "K";
    // char *divisor = "";// Handle the width of the field in which to print numbers this way to
    // make changes easier. The asterisk in the print format specifier
    // "%*I64d" takes an int from the argument list, and uses it to pad 
    // and right-justify the number being formatted.
    #define WIDTH 7void main(int argc, char *argv[])
    {
      MEMORYSTATUSEX statex;  statex.dwLength = sizeof (statex);  GlobalMemoryStatusEx (&statex);  printf ("%ld percent of memory is in use.\n",
              statex.dwMemoryLoad);
      printf ("There are %*I64d total %sbytes of physical memory.\n",
              WIDTH, statex.ullTotalPhys/DIV, divisor);
      printf ("There are %*I64d free %sbytes of physical memory.\n",
              WIDTH, statex.ullAvailPhys/DIV, divisor);
      printf ("There are %*I64d total %sbytes of paging file.\n",
              WIDTH, statex.ullTotalPageFile/DIV, divisor);
      printf ("There are %*I64d free %sbytes of paging file.\n",
              WIDTH, statex.ullAvailPageFile/DIV, divisor);
      printf ("There are %*I64x total %sbytes of virtual memory.\n",
              WIDTH, statex.ullTotalVirtual/DIV, divisor);
      printf ("There are %*I64x free %sbytes of virtual memory.\n",
              WIDTH, statex.ullAvailVirtual/DIV, divisor);  // Show the amount of extended memory available.  printf ("There are %*I64x free %sbytes of extended memory.\n",
              WIDTH, statex.ullAvailExtendedVirtual/DIV, divisor);
    }
      

  3.   

    vcforever 不服你不行啊 :(