From ea6c9e9b07627f376db9352fc634b4a219784813 Mon Sep 17 00:00:00 2001 From: reger Date: Mon, 18 Aug 2014 00:03:24 +0200 Subject: [PATCH] reduce mem buffer overhead for gap files during r/w (they are typically small compared to idx allowing to use smaller buffersize -> set to 16k records) --- source/net/yacy/kelondro/blob/Gap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/kelondro/blob/Gap.java b/source/net/yacy/kelondro/blob/Gap.java index b60fffac8..40f9193f4 100644 --- a/source/net/yacy/kelondro/blob/Gap.java +++ b/source/net/yacy/kelondro/blob/Gap.java @@ -63,7 +63,7 @@ public class Gap extends TreeMap { // read the index dump and fill the index DataInputStream is; try { - is = new DataInputStream(new BufferedInputStream(new FileInputStream(file), 1024 * 1024)); + is = new DataInputStream(new BufferedInputStream(new FileInputStream(file), (Integer.SIZE + Long.SIZE) * 1024)); // equals 16*1024*recordsize } catch (final OutOfMemoryError e) { is = new DataInputStream(new FileInputStream(file)); } @@ -93,7 +93,7 @@ public class Gap extends TreeMap { Iterator> i = this.entrySet().iterator(); DataOutputStream os; try { - os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(tmp), 4 * 1024 * 1024)); + os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(tmp), (Integer.SIZE + Long.SIZE) * 1024)); // = 16*1024*recordsize } catch (final OutOfMemoryError e) { os = new DataOutputStream(new FileOutputStream(tmp)); }