Weak References and the GC
I'm developing a client for a server, and there are times when I need to refresh some data from the server. I was thinking about putting this data in a WeakHashMap because I only need it during the display of one dialog. The data takes up a large amount of memory, and I don't want to hang onto it for a long time if it is not needed so I don't have to keep going to the server to get the list everytime. However, if I'm running low on memory I don't mind if it is GC'ed. But, looking at the docs for WeakHashMap it gives me a bad feeling because half of the Map could be GC'ed and things like that.
Is there an precedence for Weak References? Does the GC only get rid of them if it only needs more memory? Does it try zero-referenced items first then goes after Weak References?
thanks
charlie

