Package io.smallrye.common.cpu
Class CacheInfo
- java.lang.Object
-
- io.smallrye.common.cpu.CacheInfo
-
public final class CacheInfo extends Object
A class which exposes any available cache line information for the current CPU.
-
-
Constructor Summary
Constructors Constructor Description CacheInfo()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheLevelInfogetCacheLevelInfo(int index)Get the CPU cache level information for a cache level.static intgetLevelEntryCount()Get the number of CPU cache level entries.static intgetSmallestDataCacheLineSize()Get the smallest known data cache line size.static intgetSmallestInstructionCacheLineSize()Get the smallest known instruction cache line size.static voidmain(String[] args)
-
-
-
Method Detail
-
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
public static CacheLevelInfo getCacheLevelInfo(int index)
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
public static void main(String[] args)
-
-