Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Buffers, Copying and Reuse #81

Copy link
Copy link
@jbee

Description

@jbee
Issue body actions

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?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.