Why use Memory Mapped File or MapppedByteBuffer in Java
Memory Mapped Files in Java is rather new java concept for many programmers and developers, though it's been there from JDK 1.4 along with java.nio package. Java IO has been considerably fast after introduction of NIO and memory mapped file offers fastest IO operation possible in Java, that's the main reason of Why high performance Java application should use Memory Mapped files for persisting data. It's already quite popular in high frequency trading space, where electronic trading system needs to be super fast and one way latency to exchange has to be on sub-micro second level. IO has always been concern for performance sensitive applications and memory mapped file allows you to directly read from memory and write into memory by using direct and non direct Byte buffers. Key advantage of Memory Mapped File is that operating system takes care of reading and writing and even if your program crashed just after writing into memory. OS will take care of writing content to File. One more notable advantage is shared memory, memory mapped files can be accessed by more than one process and can be act as shared memory with extremely low latency.Read full article from Why use Memory Mapped File or MapppedByteBuffer in Java
No comments:
Post a Comment