If so please provide an example and also how to free the memory once created.
I imagine it might be possible using the Unsafe instance?
If so please provide an example and also how to free the memory once created.
I imagine it might be possible using the Unsafe instance?
You are probably looking for a Pool object.
Essentially - going off-heap is complex and system-dependent. However, if you pre-allocate a pool of objects you can take them and return them atomically. It would certainly ensure a more fixed and predictable latency but it would not guarantee it.