mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
Merge pull request #1186 from nevesmarcio/2.x_memleak_only
Memory leak fix in the subscribers cache
This commit is contained in:
@@ -114,11 +114,15 @@ class HazelcastAsyncMultiMap<K, V> implements AsyncMultiMap<K, V>, EntryListener
|
||||
} else {
|
||||
sids = new ChoosableSet<>(0);
|
||||
}
|
||||
ChoosableSet<V> prev = cache.putIfAbsent(k, sids);
|
||||
if (prev != null) {
|
||||
// Merge them
|
||||
prev.merge(sids);
|
||||
sids = prev;
|
||||
//SBKD-322 Quick fix for memory leak that has been caused by adding to subscribers cache
|
||||
//empty sets. When no subscribers are present just omit caching it.
|
||||
if (!sids.isEmpty()) {
|
||||
ChoosableSet<V> prev = cache.putIfAbsent(k, sids);
|
||||
if (prev != null) {
|
||||
// Merge them
|
||||
prev.merge(sids);
|
||||
sids = prev;
|
||||
}
|
||||
}
|
||||
sids.setInitialised();
|
||||
sresult.setResult(sids);
|
||||
|
||||
Reference in New Issue
Block a user