diff --git a/source/net/yacy/kelondro/blob/Heap.java b/source/net/yacy/kelondro/blob/Heap.java index db4b4bdb6..d16c252ef 100644 --- a/source/net/yacy/kelondro/blob/Heap.java +++ b/source/net/yacy/kelondro/blob/Heap.java @@ -113,7 +113,7 @@ public final class Heap extends HeapModifier implements BLOB { * @return the number of BLOBs in the heap */ @Override - public synchronized int size() { + public int size() { return super.size() + ((this.buffer == null) ? 0 : this.buffer.size()); } diff --git a/source/net/yacy/kelondro/index/RAMIndex.java b/source/net/yacy/kelondro/index/RAMIndex.java index 51f979766..7435c8c1a 100644 --- a/source/net/yacy/kelondro/index/RAMIndex.java +++ b/source/net/yacy/kelondro/index/RAMIndex.java @@ -325,7 +325,7 @@ public final class RAMIndex implements Index, Iterable { } @Override - public final synchronized int size() { + public final int size() { if (this.index0 != null && this.index1 == null) { return this.index0.size(); } @@ -337,7 +337,7 @@ public final class RAMIndex implements Index, Iterable { } @Override - public final synchronized boolean isEmpty() { + public final boolean isEmpty() { if (this.index0 != null && this.index1 == null) { return this.index0.isEmpty(); } diff --git a/source/net/yacy/kelondro/index/RAMIndexCluster.java b/source/net/yacy/kelondro/index/RAMIndexCluster.java index 3a89793dd..f64b61b10 100644 --- a/source/net/yacy/kelondro/index/RAMIndexCluster.java +++ b/source/net/yacy/kelondro/index/RAMIndexCluster.java @@ -337,26 +337,20 @@ public final class RAMIndexCluster implements Index, Iterable, Clonea @Override public final int size() { int c = 0; - synchronized (this.cluster) { - for (final RAMIndex i: this.cluster) if (i != null) c += i.size(); - } + for (final RAMIndex i: this.cluster) if (i != null) c += i.size(); return c; } @Override public long mem() { long m = 0; - synchronized (this.cluster) { - for (final RAMIndex i: this.cluster) if (i != null) m += i.mem(); - } + for (final RAMIndex i: this.cluster) if (i != null) m += i.mem(); return m; } @Override public final boolean isEmpty() { - synchronized (this.cluster) { - for (final RAMIndex i: this.cluster) if (i != null && !i.isEmpty()) return false; - } + for (final RAMIndex i: this.cluster) if (i != null && !i.isEmpty()) return false; return true; }