java.lang.Object
io.smallrye.common.cpu.CacheInfo
A class which exposes any available cache line information for the current CPU.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CacheLevelInfogetCacheLevelInfo(int index) Get the CPU cache level information for a cache level.static intGet the number of CPU cache level entries.static intGet the smallest known data cache line size.static intGet the smallest known instruction cache line size.static voidA simple main method which prints cache info when called.
-
Method Details
-
getLevelEntryCount
public static int getLevelEntryCount()Get the number of CPU cache level entries. If no cache information could be gathered, 0 is returned.- Returns:
- the number of CPU cache levels, or 0 if unknown
-
getCacheLevelInfo
Get the CPU cache level information for a cache level. Theindexargument must be greater than zero and less than the number of levels returned bygetLevelEntryCount().- Parameters:
index- the cache level index- Returns:
- the CPU cache level information
-
getSmallestDataCacheLineSize
public static int getSmallestDataCacheLineSize()Get the smallest known data cache line size. If no cache line sizes are known, 0 is returned. Note that smaller cache lines may exist if one or more cache line sizes are unknown.- Returns:
- the smallest cache line size, or 0 if unknown
-
getSmallestInstructionCacheLineSize
public static int getSmallestInstructionCacheLineSize()Get the smallest known instruction cache line size. If no cache line sizes are known, 0 is returned. Note that smaller cache lines may exist if one or more cache line sizes are unknown.- Returns:
- the smallest cache line size, or 0 if unknown
-
main
A simple main method which prints cache info when called.- Parameters:
args- ignored
-