Steve, if by "dereferencing"* you mean removing references to an object by setting them to null or to some other object, that's really the only way to delete objects in
Java. Then you wait for garbage collection to take effect. If you want to do that using multiple threads, that's certainly possible. E.g. one thread could slowly set references to null, and another thread could be loading new data. I don't see any particular benefit or problem here; I suppose it really depends on how you know when data may be safely removed. You could, for example, have a thread that just keeps scanning the data and removing anything that's older than a certain amount of time.
* Normally "dereference" means something else entirely - the act of using a reference to look up the data it refers to. In Java this is normally done implicitly, and we don't usually talk about it as it's the normal way references work in Java. But in C/C++ you would do it with the indirection operator, *, which is the opposite of the reference operator, &. Which doesn't really matter much to use here, except to say that dereferencing does
not mean removing a reference.
[ June 12, 2007: Message edited by: Jim Yingst ]