From 9b262a7363bb8534db3feef3f064bf2d8d9c23d2 Mon Sep 17 00:00:00 2001 From: kimchy Date: Sun, 24 Apr 2011 22:48:38 +0300 Subject: [PATCH] clean teh lzf buffer recycler --- .../src/main/java/org/elasticsearch/common/CacheRecycler.java | 2 ++ .../org/elasticsearch/common/compress/lzf/BufferRecycler.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/CacheRecycler.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/CacheRecycler.java index f729241763a..e3f1084a50f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/CacheRecycler.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/CacheRecycler.java @@ -19,6 +19,7 @@ package org.elasticsearch.common; +import org.elasticsearch.common.compress.lzf.BufferRecycler; import org.elasticsearch.common.trove.ExtTDoubleObjectHashMap; import org.elasticsearch.common.trove.ExtTHashMap; import org.elasticsearch.common.trove.ExtTLongObjectHashMap; @@ -32,6 +33,7 @@ import java.util.Deque; public class CacheRecycler { public static void clear() { + BufferRecycler.clean(); doubleObjectHashMap.remove(); longObjectHashMap.remove(); longLongHashMap.remove(); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/lzf/BufferRecycler.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/lzf/BufferRecycler.java index 20924e0171b..440b013f50c 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/lzf/BufferRecycler.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/lzf/BufferRecycler.java @@ -64,6 +64,10 @@ public class BufferRecycler { return br; } + public static void clean() { + _recyclerRef.remove(); + } + /* /////////////////////////////////////////////////////////////////////// // Buffers for encoding (output)