Class OpenBsdVirtualMemory
- java.lang.Object
-
- oshi.hardware.common.AbstractVirtualMemory
-
- oshi.hardware.platform.unix.openbsd.OpenBsdVirtualMemory
-
- All Implemented Interfaces:
VirtualMemory
@ThreadSafe final class OpenBsdVirtualMemory extends AbstractVirtualMemory
Memory info on OpenBSD
-
-
Field Summary
Fields Modifier and Type Field Description private OpenBsdGlobalMemory
global
private java.util.function.Supplier<java.lang.Integer>
pgout
private java.util.function.Supplier<Triplet<java.lang.Integer,java.lang.Integer,java.lang.Integer>>
usedTotalPgin
-
Constructor Summary
Constructors Constructor Description OpenBsdVirtualMemory(OpenBsdGlobalMemory freeBsdGlobalMemory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getSwapPagesIn()
Number of pages read from paging/swap file(s) to resolve hard page faults.long
getSwapPagesOut()
Number of pages written to paging/swap file(s) to free up space in physical memory.long
getSwapTotal()
The current size of the paging/swap file(s), in bytes.long
getSwapUsed()
The current memory committed to the paging/swap file(s), in byteslong
getVirtualInUse()
The memory currently committed by the system, in bytes.long
getVirtualMax()
The maximum memory that can be committed by the system without extending the paging file(s), in bytes.private static int
queryUvm()
private static Triplet<java.lang.Integer,java.lang.Integer,java.lang.Integer>
queryVmstat()
-
Methods inherited from class oshi.hardware.common.AbstractVirtualMemory
toString
-
-
-
-
Field Detail
-
global
private final OpenBsdGlobalMemory global
-
usedTotalPgin
private final java.util.function.Supplier<Triplet<java.lang.Integer,java.lang.Integer,java.lang.Integer>> usedTotalPgin
-
pgout
private final java.util.function.Supplier<java.lang.Integer> pgout
-
-
Constructor Detail
-
OpenBsdVirtualMemory
OpenBsdVirtualMemory(OpenBsdGlobalMemory freeBsdGlobalMemory)
-
-
Method Detail
-
getSwapUsed
public long getSwapUsed()
Description copied from interface:VirtualMemory
The current memory committed to the paging/swap file(s), in bytes- Returns:
- Swap used in bytes
-
getSwapTotal
public long getSwapTotal()
Description copied from interface:VirtualMemory
The current size of the paging/swap file(s), in bytes. If the paging/swap file can be extended, this is a soft limit.- Returns:
- Total swap in bytes.
-
getVirtualMax
public long getVirtualMax()
Description copied from interface:VirtualMemory
The maximum memory that can be committed by the system without extending the paging file(s), in bytes. Also called the Commit Limit. If the paging/swap file can be extended, this is a soft limit. This is generally equal to the sum of the sizes of physical memory and paging/swap file(s).On Linux, represents the total amount of memory currently available to be allocated on the system based on the overcommit ratio, identified as
CommitLimit
. This may be higher or lower than the total size of physical and swap memory depending on system configuration.- Returns:
- Max Virtual Memory in bytes
-
getVirtualInUse
public long getVirtualInUse()
Description copied from interface:VirtualMemory
The memory currently committed by the system, in bytes. Also called the Commit Total. This is generally equal to the sum of the bytes used of physical memory and paging/swap file(s).On Windows, committing pages changes this value immediately; however, the physical memory is not charged until the pages are accessed, so this value may exceed the sum of used physical and paging/swap file memory.
- Returns:
- Swap used in bytes
-
getSwapPagesIn
public long getSwapPagesIn()
Description copied from interface:VirtualMemory
Number of pages read from paging/swap file(s) to resolve hard page faults. (Hard page faults occur when a process requires code or data that is not in its working set or elsewhere in physical memory, and must be retrieved from disk.) This property was designed as a primary indicator of the kinds of faults that cause system-wide delays. It includes pages retrieved to satisfy faults in the file system cache (usually requested by applications) and in non-cached mapped memory files.- Returns:
- Pages swapped in
-
getSwapPagesOut
public long getSwapPagesOut()
Description copied from interface:VirtualMemory
Number of pages written to paging/swap file(s) to free up space in physical memory. Pages are written back to disk only if they are changed in physical memory, so they are likely to hold data, not code. A high rate of pages output might indicate a memory shortage. The operating system writes more pages back to disk to free up space when physical memory is in short supply.- Returns:
- Pages swapped out
-
queryVmstat
private static Triplet<java.lang.Integer,java.lang.Integer,java.lang.Integer> queryVmstat()
-
queryUvm
private static int queryUvm()
-
-