Skip to content

4.1.0

Latest

Choose a tag to compare

@oschwald oschwald released this 12 May 18:44
Immutable release. Only release title and notes can be modified.
65e28b6
  • Fixed unbounded off-heap memory growth when initializing the reader in
    FileMode.MEMORY. The previous implementation read the database via
    FileChannel.read() into a heap buffer, which causes the JDK to cache
    temporary direct ByteBuffers in per-thread storage
    (sun.nio.ch.Util.BufferCache). Repeated initialization across different
    threads could grow this cache without bound. The reader now uses
    FileInputStream for MEMORY mode, which bypasses the cache.
    FileMode.MEMORY_MAPPED was unaffected.
  • Fixed a latent short-read bug in the multi-chunk FileMode.MEMORY
    load path introduced in 4.0.0. FileChannel.read(ByteBuffer) is not
    contractually obligated to fully fill the destination buffer; a
    short read could have caused silent truncation of an in-memory
    database. Affects databases larger than ~2GB (the default chunk
    size). The new chunked read loop retries until each chunk is fully
    populated.