Class WindowsGlobalMemory

java.lang.Object
oshi.hardware.common.AbstractGlobalMemory
oshi.hardware.platform.windows.WindowsGlobalMemory
All Implemented Interfaces:
GlobalMemory

@ThreadSafe final class WindowsGlobalMemory extends AbstractGlobalMemory
Memory obtained by Performance Info.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • IS_WINDOWS10_OR_GREATER

      private static final boolean IS_WINDOWS10_OR_GREATER
    • availTotalSize

      private final Supplier<Triplet<Long,Long,Long>> availTotalSize
    • vm

      private final Supplier<VirtualMemory> vm
  • Constructor Details

    • WindowsGlobalMemory

      WindowsGlobalMemory()
  • Method Details

    • getAvailable

      public long getAvailable()
      Description copied from interface: GlobalMemory
      The amount of physical memory currently available, in bytes.
      Returns:
      Available number of bytes.
    • getTotal

      public long getTotal()
      Description copied from interface: GlobalMemory
      The amount of actual physical memory, in bytes.
      Returns:
      Total number of bytes.
    • getPageSize

      public long getPageSize()
      Description copied from interface: GlobalMemory
      The number of bytes in a memory page
      Returns:
      Page size in bytes.
    • getVirtualMemory

      public VirtualMemory getVirtualMemory()
      Description copied from interface: GlobalMemory
      Virtual memory, such as a swap file.
      Returns:
      A VirtualMemory object.
    • createVirtualMemory

      private VirtualMemory createVirtualMemory()
    • getPhysicalMemory

      public List<PhysicalMemory> getPhysicalMemory()
      Description copied from interface: GlobalMemory
      Physical memory, such as banks of memory.

      On Linux, requires elevated permissions. On FreeBSD and Solaris, requires installation of dmidecode.

      Specified by:
      getPhysicalMemory in interface GlobalMemory
      Overrides:
      getPhysicalMemory in class AbstractGlobalMemory
      Returns:
      A list of PhysicalMemory objects.
    • memoryType

      private static String memoryType(int type)
      Convert memory type number to a human readable string
      Parameters:
      type - The memory type
      Returns:
      A string describing the type
    • smBiosMemoryType

      private static String smBiosMemoryType(int type)
      Convert SMBIOS type number to a human readable string
      Parameters:
      type - The SMBIOS type
      Returns:
      A string describing the type
    • readPerfInfo

      private static Triplet<Long,Long,Long> readPerfInfo()