Fixes #1186 limit the number of items in the ThreadLocal list in the ConcurrentBag.

pull/1159/merge
Brett Wooldridge 7 years ago
parent d0cb0f8dab
commit 52b3811e4d

@ -195,7 +195,9 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
}
final List<Object> threadLocalList = threadList.get();
threadLocalList.add(weakThreadLocals ? new WeakReference<>(bagEntry) : bagEntry);
if (threadLocalList.size() < 50) {
threadLocalList.add(weakThreadLocals ? new WeakReference<>(bagEntry) : bagEntry);
}
}
/**

Loading…
Cancel
Save