Package oshi.hardware.platform.windows
Class WindowsVirtualMemory
java.lang.Object
oshi.hardware.common.AbstractVirtualMemory
oshi.hardware.platform.windows.WindowsVirtualMemory
- All Implemented Interfaces:
VirtualMemory
public class WindowsVirtualMemory extends AbstractVirtualMemory
Memory obtained from WMI
-
Constructor Summary
Constructors Constructor Description WindowsVirtualMemory(long pageSize)Constructor for WindowsVirtualMemory. -
Method Summary
Modifier and Type Method Description longgetSwapPagesIn()Number of pages read from paging/swap file(s) to resolve hard page faults.longgetSwapPagesOut()Number of pages written to paging/swap file(s) to free up space in physical memory.longgetSwapTotal()The current size of the paging/swap file(s), in bytes.longgetSwapUsed()The current memory committed to the paging/swap file(s), in bytes
-
Constructor Details
-
WindowsVirtualMemory
public WindowsVirtualMemory(long pageSize)Constructor for WindowsVirtualMemory.
- Parameters:
pageSize- The size in bites of memory pages
-
-
Method Details
-
getSwapUsed
public long getSwapUsed()Description copied from interface:VirtualMemoryThe current memory committed to the paging/swap file(s), in bytes- Returns:
- Swap used in bytes
-
getSwapTotal
public long getSwapTotal()Description copied from interface:VirtualMemoryThe 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.
-
getSwapPagesIn
public long getSwapPagesIn()Description copied from interface:VirtualMemoryNumber 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:VirtualMemoryNumber 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
-