Nanosai Mem Ops (Java): Open Source Memory Manager/Allocator for Highly Resilient Distributed Systems

What Is Mem Ops?

Mem Ops (Java) is a small toolkit by our team at Nanosai for allocating and deallocating byte arrays for use in software that requires steady state memory consumption. By steady state we mean that the total amount of memory stays either constant, or very near constant, and where there are as few and short garbage collection pauses as possible.

Typical use cases for Mem Ops are inside a server that receives and sends thousands of messages per second, or inside a data streaming engine that needs to process gigabytes of data per second.
Mem Ops works by allocating one big byte array from which you can allocate smaller blocks (sections) for storing a block of bytes, e.g. an incoming or outgoing message, or a data block from a disk etc. When you are done using the block you explicitly free it again so Mem Ops knows that this section can now be reused. Mem Ops is capable of defragmenting the big byte array, either immediately when blocks are freed, or you can trigger the defragmentation (garbage collection) when your system has time available.

The reason we`re releasing Mem Ops before any of our other, probably more exciting building blocks, is that getting memory management right is crucial for a high performance, high resilience system. So crucial that we have even taken memory management into consideration when designing the core binary data format for our ecosystem (also to be released open source in due course).

Finally, you can visit Mem Ops tutorial page and GitHub to learn more.

2 Likes