Class OpenBsdGlobalMemory
- java.lang.Object
-
- oshi.hardware.common.AbstractGlobalMemory
-
- oshi.hardware.platform.unix.openbsd.OpenBsdGlobalMemory
-
- All Implemented Interfaces:
GlobalMemory
@ThreadSafe final class OpenBsdGlobalMemory extends AbstractGlobalMemory
Memory obtained by sysctl vm.stats
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<java.lang.Long>availableprivate java.util.function.Supplier<java.lang.Long>pageSizeprivate java.util.function.Supplier<java.lang.Long>totalprivate java.util.function.Supplier<VirtualMemory>vm
-
Constructor Summary
Constructors Constructor Description OpenBsdGlobalMemory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private VirtualMemorycreateVirtualMemory()longgetAvailable()The amount of physical memory currently available, in bytes.longgetPageSize()The number of bytes in a memory pagelonggetTotal()The amount of actual physical memory, in bytes.VirtualMemorygetVirtualMemory()Virtual memory, such as a swap file.private static longqueryAvailable()private static longqueryPageSize()private static longqueryPhysMem()-
Methods inherited from class oshi.hardware.common.AbstractGlobalMemory
getPhysicalMemory, toString
-
-
-
-
Field Detail
-
available
private final java.util.function.Supplier<java.lang.Long> available
-
total
private final java.util.function.Supplier<java.lang.Long> total
-
pageSize
private final java.util.function.Supplier<java.lang.Long> pageSize
-
vm
private final java.util.function.Supplier<VirtualMemory> vm
-
-
Method Detail
-
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
public VirtualMemory getVirtualMemory()
Description copied from interface:GlobalMemoryVirtual memory, such as a swap file.- Returns:
- A VirtualMemory object.
-
queryAvailable
private static long queryAvailable()
-
queryPhysMem
private static long queryPhysMem()
-
queryPageSize
private static long queryPageSize()
-
createVirtualMemory
private VirtualMemory createVirtualMemory()
-
-