From 1addbc792c25641e7ef018b868cb0ea98255d979 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 8 Jul 2012 22:05:04 +0200 Subject: [PATCH] use less memory for md5 cache --- source/net/yacy/kelondro/order/Digest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/kelondro/order/Digest.java b/source/net/yacy/kelondro/order/Digest.java index ebe31d9c4..f8bf4d575 100644 --- a/source/net/yacy/kelondro/order/Digest.java +++ b/source/net/yacy/kelondro/order/Digest.java @@ -56,10 +56,11 @@ public class Digest { public static BlockingQueue digestPool = new LinkedBlockingDeque(); - private static final int md5CacheSize = Math.max(100000, Math.min(1000000, (int) (MemoryControl.available() / 40000L))); + private static final int md5CacheSize = Math.max(1000, Math.min(1000000, (int) (MemoryControl.available() / 50000L))); private static ARC md5Cache = null; static { try { + Log.logInfo("Digest", "creating hash cache of size " + md5CacheSize); md5Cache = new ConcurrentARC(md5CacheSize, Math.max(8, 2 * Runtime.getRuntime().availableProcessors())); } catch (final OutOfMemoryError e) { md5Cache = new ConcurrentARC(1000, Math.max(2, Runtime.getRuntime().availableProcessors()));