Package oshi.hardware.platform.mac
Class MacGlobalMemory
java.lang.Object
oshi.hardware.common.AbstractGlobalMemory
oshi.hardware.platform.mac.MacGlobalMemory
- All Implemented Interfaces:
GlobalMemory
public class MacGlobalMemory extends AbstractGlobalMemory
Memory obtained by host_statistics (vm_stat) and sysctl.
-
Constructor Summary
Constructors Constructor Description MacGlobalMemory() -
Method Summary
Modifier and Type Method Description longgetAvailable()The amount of physical memory currently available, in bytes.longgetPageSize()The number of bytes in a memory pagePhysicalMemory[]getPhysicalMemory()Physical memory, such as banks of memory.longgetTotal()The amount of actual physical memory, in bytes.VirtualMemorygetVirtualMemory()Virtual memory, such as a swap file.Methods inherited from class oshi.hardware.common.AbstractGlobalMemory
parsePhysicalMemorySize, toString
-
Constructor Details
-
MacGlobalMemory
public MacGlobalMemory()
-
-
Method Details
-
getAvailable
public long getAvailable()Description copied from interface:GlobalMemoryThe amount of physical memory currently available, in bytes.- Returns:
- Available number of bytes.
-
getTotal
public long getTotal()Description copied from interface:GlobalMemoryThe amount of actual physical memory, in bytes.- Returns:
- Total number of bytes.
-
getPageSize
public long getPageSize()Description copied from interface:GlobalMemoryThe number of bytes in a memory page- Returns:
- Page size in bytes.
-
getVirtualMemory
Description copied from interface:GlobalMemoryVirtual memory, such as a swap file.- Returns:
- A VirtualMemory object.
-
getPhysicalMemory
Description copied from interface:GlobalMemoryPhysical memory, such as banks of memory.On Linux, requires elevated permissions. On FreeBSD and Solaris, requires installation of dmidecode.
- Specified by:
getPhysicalMemoryin interfaceGlobalMemory- Overrides:
getPhysicalMemoryin classAbstractGlobalMemory- Returns:
- A list of PhysicalMemory objects.
-