You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a pure question to get my understanding straight.
In connection with LMDB the is talk about zero copying.
My understanding would be that one can use a off-heap buffer that points directly at the memory LMDB uses for a key or value. In a read-only case we would not have to copy such a buffer for reading from it. The Java class handling it would have that pointer and some fields for the position etcetera. What about writing? Is there any coping? Why not?
Netty and Agrona provide such a buffers. What is the minimal way to use one of these? Copy code from somewhere?
If on the other hand one uses a JRE DirectByteBuffer we allocate off-heap memory and the key or value is copied from LMDBs memory into the allocated memory or vice versa.
If that is correct I got the idea that I can have a single JRE buffer allocated for values when writing that I reuse all the time since there only could be one thread writing at a time anyway. Is this good practice or a bad idea? If so why?
This is a pure question to get my understanding straight.
In connection with LMDB the is talk about zero copying.
My understanding would be that one can use a off-heap buffer that points directly at the memory LMDB uses for a key or value. In a read-only case we would not have to copy such a buffer for reading from it. The Java class handling it would have that pointer and some fields for the position etcetera. What about writing? Is there any coping? Why not?
Netty and Agrona provide such a buffers. What is the minimal way to use one of these? Copy code from somewhere?
If on the other hand one uses a JRE
DirectByteBufferwe allocate off-heap memory and the key or value is copied from LMDBs memory into the allocated memory or vice versa.If that is correct I got the idea that I can have a single JRE buffer allocated for values when writing that I reuse all the time since there only could be one thread writing at a time anyway. Is this good practice or a bad idea? If so why?