When using direct memory can be faster
Overview Using direct memory is no guarantee of improving performance. Given it adds complexity, it should be avoided unless you have a compelling reason to use it. This excellent article by Sergio Oliveira Jr shows its not simply a matter of using direct memory to improve performance Which one is faster: Java heap or native memory? Where direct memory and memory mapped files can help is when you have a large amounts of data and/or you have to perform some IO with that data. Time series data. Time series data tends to have both a large number of entries and involve IO to load and store the data. This makes it a good candidate for memory mapped files and direct memory. I have provided an example here; main and tests where the same operations are performed on regular objects and on memory mapped files. Note: I am not suggesting that the access to the Objects is slow but the overhead of using objects which is the issue. e.g. loading, creating, th...