public static void warmup() { try { Jvm.disableDebugHandler(); @NotNull File file = File.createTempFile("delete", "me"); file.deleteOnExit(); long mapAlignment = OS.mapAlignment(); int chunks = 64; int compileThreshold = Jvm.compileThreshold(); for (int j = 0; j <= compileThreshold; j += chunks) { try { try (@NotNull RandomAccessFile raf = new RandomAccessFile(file, "rw")) { @NotNull MappedFile mappedFile = new MappedFile(file, raf, mapAlignment, 0, mapAlignment * chunks, false); warmup0(mapAlignment, chunks, mappedFile); mappedFile.release(); } Thread.yield(); Files.delete(file.toPath()); } catch (IOException e) { Jvm.debug().on(MappedFile.class, "Error during warmup", e); } } } catch (IOException e) { Jvm.warn().on(MappedFile.class, "Error during warmup", e); } Jvm.resetExceptionHandlers(); }