示例#1
0
 [System.Security.SecurityCritical]  // auto-generated
 private static void CheckForAvailableMemory(out ulong availPageFile, out ulong totalAddressSpaceFree)
 {
     bool r;
     Win32Native.MEMORYSTATUSEX memory = new Win32Native.MEMORYSTATUSEX();
     r = Win32Native.GlobalMemoryStatusEx(ref memory);
     if (!r)
         __Error.WinIOError();
     availPageFile = memory.availPageFile;
     totalAddressSpaceFree = memory.availVirtual;
     //Console.WriteLine("Memory gate:  Mem load: {0}%  Available memory (physical + page file): {1} MB  Total free address space: {2} MB  GC Heap: {3} MB", memory.memoryLoad, memory.availPageFile >> 20, memory.availVirtual >> 20, GC.GetTotalMemory(true) >> 20);
 }
 private static void CheckForAvailableMemory(out ulong availPageFile, out ulong totalAddressSpaceFree)
 {
     Win32Native.MEMORYSTATUSEX buffer = new Win32Native.MEMORYSTATUSEX();
     if (!Win32Native.GlobalMemoryStatusEx(buffer))
     {
         __Error.WinIOError();
     }
     availPageFile = buffer.availPageFile;
     totalAddressSpaceFree = buffer.availVirtual;
 }