I have found a class called WeakHashMap in Scala which looks to simply wrap the corresponding Java class. This weak hash table allows entries to be removed from he table (and eventually GCed) when the key becomes otherwise dereferenced.

QUESTION: Is there an implementation I can use which allows the entry to removed from the table when the value becomes otherwise unreferenced?

There is similar question here but it only pertains to removal when key is dereferenced--doesn't address the problem of value becoming unreferenced.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.