Problem Sometimes in advanced OOP scenarios, a class needs to hold instances of another class which needs to hold a […]
Tag: weak-references
Class with multiple parameters as the object of a WeakReference
Problem I just read this post on how to avoid memory leaks with AsyncTask. The post proposed using a WeakReference […]
WeakReference in AsyncTask
Problem I want to use the WeakReference approach to not leak memory with my AsyncTask. I found examples online and […]
Solution for Parent/Child circular references: WeakReference class
Problem Sometimes in advanced OOP scenarios, a class needs to hold instances of another class which needs to hold a […]
Class with multiple parameters as the object of a WeakReference
Problem I just read this post on how to avoid memory leaks with AsyncTask. The post proposed using a WeakReference […]
Lightweight flexible observer framework using weak references
Problem I found a need for a simple, generic publish-subscribe framework for my Java application. I looked over a few […]
WeakReference in AsyncTask
Problem I want to use the WeakReference approach to not leak memory with my AsyncTask. I found examples online and […]
“Removing” reference from its ReferenceQueue
Problem Sometimes I need to ensure that some references won’t be processed while examination from the associated ReferenceQueue. Generally at […]
Minimal Map implementation with weak values
Problem What follows is an implementation of the java.util.Map interface with weak values. This means that entries should be removed […]