Carpet

Carpet

2M Downloads

`synchronize` can leak memory

altrisi opened this issue ยท 0 comments

commented

Every time you pass a different value to synchronize, it will create a dummy object to be used as a lock (given synchronizing in current values would be useless), and will synchronize on that lock. However, that lock object is never removed from the map, effectively creating a memory leak.

Fixing this issue isn't as simple as creating a WeakHashMap, because of the same reason synchronize isn't as simple as synchronizing on the value, so a different way is needed.