Skip to content

Add support for MemoryMapped Files. #397

Open
@Cyberavater

Description

Very self-explanatory, typical write API can be very CPU extensive when writing a small amount in each iteration.
The solution is MemoryMapped Files. most platforms support it.

For JVM, I recommend against using the JDK-provided MappedByteBuffer and implementing it from scratch with JNA/JNR.
MappedByteBuffer cons:

  1. You cannot unmap at will while it's very possible to do so if you call the native API for that. [This is useful if you want to have a dynamic-sized mapped file, ie take a reasonable-sized chunk, and if it's more than needed you can just unmap and resize internally, JDK 8 implementation doesn't provide any solution for that, but Panama solves it, which is not usable on android]
  2. Bulk write on Android SDK is missing, so for that you'll have to write JNA either way.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions