#include
#include
#define DIV 1048576
void main(int argc, char *argv[])
{
MEMORYSTATUS stat;
GlobalMemoryStatus (&stat);
printf ("The MemoryStatus structure is %ld bytes long.\n",
stat.dwLength);
printf ("It should be %d.\n", sizeof (stat));
printf ("%ld percent of memory is in use.\n",
stat.dwMemoryLoad);
printf ("There are %ld total M of physical memory.\n",
stat.dwTotalPhys/DIV);
printf ("There are %ld free M of physical memory.\n",
stat.dwAvailPhys/DIV);
printf ("There are %ld total M of paging file.\n",
stat.dwTotalPageFile/DIV);
printf ("There are %ld free M of paging file.\n",
stat.dwAvailPageFile/DIV);
printf ("There are %ld total M of virtual memory.\n",
stat.dwTotalVirtual/DIV);
printf ("There are %ld free M of virtual memory.\n",
stat.dwAvailVirtual/DIV);
}
阅读(1576) | 评论(0) | 转发(0) |