method signalEvent() in DNSStatefulObjectSemaphore was not removing semaphores from the correct collection, it was removing them from the local copy (used only for iteration), and not actually from the class's ConcurrentHashMap - thus it was holding/'leaking' resources, including references to threads (ouch), preventing garbage collection.
Patch is a one-liner! :)
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
actually, i'll admit that i'm not overly familiar with the code, so please feel free to reject my patch if the original code is as-intended,
The code is actually correct. If you check the JavaDoc for the ConcurrentHashMap the method values() return a live collection backed by the map and it explicitly state that removal of an element in the collection remove an element in the map.
Cheers
Pierre
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
ah ok - yes, you're correct - sorry for the oversight.
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"