Class AixGlobalMemory

java.lang.Object
oshi.hardware.common.AbstractGlobalMemory
oshi.hardware.common.platform.unix.aix.AixGlobalMemory
All Implemented Interfaces:
GlobalMemory

@ThreadSafe public abstract class AixGlobalMemory extends AbstractGlobalMemory
Abstract base for AIX GlobalMemory. The public AbstractGlobalMemory API translates perfstat_memory_total_t fields into bytes; getPhysicalMemory() parses the shared lscfg supplier passed in from the HAL. Subclasses provide the perfstat field accessors and the matching AixVirtualMemory.
  • Field Details

  • Constructor Details

  • 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.
    • 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.
    • queryRealAvail

      protected abstract long queryRealAvail()
      Reads perfstat_memory_total_t.real_avail (4 KB pages) via the subclass.
      Returns:
      real_avail in pages
    • queryRealTotal

      protected abstract long queryRealTotal()
      Reads perfstat_memory_total_t.real_total (4 KB pages) via the subclass.
      Returns:
      real_total in pages
    • getVirtualMemory

      public abstract VirtualMemory getVirtualMemory()
      Constructs the matching AixVirtualMemory (JNA or FFM) for this instance.
      Returns:
      the VirtualMemory paired with this GlobalMemory implementation