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 60cf18cf20
commit 94f3930850

View File

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