src/hotspot/os/windows/os_windows.cpp
changeset 50236 a11c1cb542bb
parent 50184 1a4101ebec92
child 50429 83aec1d357d4
equal deleted inserted replaced
50235:ff5d0ea58d9b 50236:a11c1cb542bb
  1743 
  1743 
  1744   // Use GlobalMemoryStatusEx() because GlobalMemoryStatus() may return incorrect
  1744   // Use GlobalMemoryStatusEx() because GlobalMemoryStatus() may return incorrect
  1745   // value if total memory is larger than 4GB
  1745   // value if total memory is larger than 4GB
  1746   MEMORYSTATUSEX ms;
  1746   MEMORYSTATUSEX ms;
  1747   ms.dwLength = sizeof(ms);
  1747   ms.dwLength = sizeof(ms);
  1748   GlobalMemoryStatusEx(&ms);
  1748   int r1 = GlobalMemoryStatusEx(&ms);
  1749 
  1749 
  1750   st->print(", physical %uk", os::physical_memory() >> 10);
  1750   if (r1 != 0) {
  1751   st->print("(%uk free)", os::available_memory() >> 10);
  1751     st->print(", system-wide physical " INT64_FORMAT "M ",
  1752 
  1752              (int64_t) ms.ullTotalPhys >> 20);
  1753   st->print(", swap %uk", ms.ullTotalPageFile >> 10);
  1753     st->print("(" INT64_FORMAT "M free)\n", (int64_t) ms.ullAvailPhys >> 20);
  1754   st->print("(%uk free)", ms.ullAvailPageFile >> 10);
  1754 
       
  1755     st->print("TotalPageFile size " INT64_FORMAT "M ",
       
  1756              (int64_t) ms.ullTotalPageFile >> 20);
       
  1757     st->print("(AvailPageFile size " INT64_FORMAT "M)",
       
  1758              (int64_t) ms.ullAvailPageFile >> 20);
       
  1759 
       
  1760     // on 32bit Total/AvailVirtual are interesting (show us how close we get to 2-4 GB per process borders)
       
  1761 #if defined(_M_IX86)
       
  1762     st->print(", user-mode portion of virtual address-space " INT64_FORMAT "M ",
       
  1763              (int64_t) ms.ullTotalVirtual >> 20);
       
  1764     st->print("(" INT64_FORMAT "M free)", (int64_t) ms.ullAvailVirtual >> 20);
       
  1765 #endif
       
  1766   } else {
       
  1767     st->print(", GlobalMemoryStatusEx did not succeed so we miss some memory values.");
       
  1768   }
       
  1769 
       
  1770   // extended memory statistics for a process
       
  1771   PROCESS_MEMORY_COUNTERS_EX pmex;
       
  1772   ZeroMemory(&pmex, sizeof(PROCESS_MEMORY_COUNTERS_EX));
       
  1773   pmex.cb = sizeof(pmex);
       
  1774   int r2 = GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*) &pmex, sizeof(pmex));
       
  1775 
       
  1776   if (r2 != 0) {
       
  1777     st->print("\ncurrent process WorkingSet (physical memory assigned to process): " INT64_FORMAT "M, ",
       
  1778              (int64_t) pmex.WorkingSetSize >> 20);
       
  1779     st->print("peak: " INT64_FORMAT "M\n", (int64_t) pmex.PeakWorkingSetSize >> 20);
       
  1780 
       
  1781     st->print("current process commit charge (\"private bytes\"): " INT64_FORMAT "M, ",
       
  1782              (int64_t) pmex.PrivateUsage >> 20);
       
  1783     st->print("peak: " INT64_FORMAT "M", (int64_t) pmex.PeakPagefileUsage >> 20);
       
  1784   } else {
       
  1785     st->print("\nGetProcessMemoryInfo did not succeed so we miss some memory values.");
       
  1786   }
       
  1787 
  1755   st->cr();
  1788   st->cr();
  1756 }
  1789 }
  1757 
  1790 
  1758 void os::print_siginfo(outputStream *st, const void* siginfo) {
  1791 void os::print_siginfo(outputStream *st, const void* siginfo) {
  1759   const EXCEPTION_RECORD* const er = (EXCEPTION_RECORD*)siginfo;
  1792   const EXCEPTION_RECORD* const er = (EXCEPTION_RECORD*)siginfo;