3 ms·
If you don't mind using a preview feature you should be able to use the foreign function API to call mlockall without any unsafe code. Otherwise, JNA is probab
by papercrane 2y ago
If you don't mind using a preview feature you should be able to use the foreign function API to call mlockall without any unsafe code.
Otherwise, JNA is probably the easiest way, and how Cassandra does it.
https://docs.oracle.com/en/java/javase/21/core/calling-c-library-function-foreign-function-and-memory-api.html https://docs.oracle.com/en/java/javase/21/core/calling-c-lib...
https://github.com/java-native-access/jna https://github.com/java-native-access/jna