Recycler availableSharedCapacity will be slowly exhausted due missing reclaimSpace(...) call (#9394)

Motivation:

We did miss to call reclaimSpace(...) in one case which can lead to the situation of having the Recycler to not correctly reclaim space and so just create new objects when not needed.

Modifications:

Correctly call reclaimSpace(...)

Result:

Recycler correctly reclaims space in all situations.
This commit is contained in:
YuanHu 2019-07-22 03:06:31 +08:00 committed by Norman Maurer
parent a677e62dd0
commit 90b788bef7

View File

@ -384,6 +384,7 @@ public abstract class Recycler<T> {
return false;
}
this.head.link = head = head.next;
this.head.reclaimSpace(LINK_CAPACITY);
}
final int srcStart = head.readIndex;