Index: oak-segment/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileAccess.java =================================================================== --- oak-segment/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileAccess.java (revision 1740460) +++ oak-segment/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileAccess.java (working copy) @@ -45,9 +45,12 @@ */ static class Mapped extends FileAccess { - private final MappedByteBuffer buffer; + private final RandomAccessFile file; + private MappedByteBuffer buffer; + Mapped(RandomAccessFile file) throws IOException { + this.file = file; this.buffer = file.getChannel().map(READ_ONLY, 0, file.length()); } @@ -70,7 +73,9 @@ } @Override - public void close() { + public void close() throws IOException { + buffer = null; + file.close(); } }