Open
Description
running JDK 24 on ARM64
This is not thermal throttling - as a ctrl-c and restart immediately run at full concurrency
for (long part = 0; part < (batches + 1) ; part++) {
// generate a limited collection (CopyOnWriteArrayList not required as r/o) for the search space - 32 is a good
List<ULong128> oddNumbers = LongStream
.rangeClosed(rangeStart + (part * threads), rangeStart + ((1 + part) * threads) - 1)
.filter(x -> x % 2 != 0) // TODO: find a way to avoid this filter using range above
.boxed()
.map(ULong128Impl::new)
.collect(Collectors.toList());
// filter on max value or path
List<ULong128> results = oddNumbers
.parallelStream()
.filter(num -> isCollatzMax(num, secondsStart))
.collect(Collectors.toList());
Until we get an RCA - Add a System call
95% of the time we run at full core count
periodically we get stuck at less than half the concurrency
Old school
JDK 9+
OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
double processCpuLoad = osBean.getProcessCpuLoad();
double systemCpuLoad = osBean.getSystemCpuLoad();
System.out.println("Process CPU Load: " + processCpuLoad);
System.out.println("System CPU Load: " + systemCpuLoad);