views:

664

answers:

2

Has anyone researched the runtime costs involved in creating and garbage collecting Java WeakReference objects? Are there any performance issues (e.g. contention) for multi-threaded applications?

EDIT: Obviously the actual answer(s) will be JVM dependent, but general observations are also welcome.

+1  A: 

Obviously this will depend on the JDK implementation, Sun vs IBM vs JRockit etc.

David Plumpton
Obviously :-). I have updated the question.
Stephen C
+5  A: 

WeakReferences have negative impact on CMS garbage collector. As far as I can see from behavior of our server it influences parallel remark phase time. During this phase all app threads are stopped so it's extremely undesirable thing. So you need to be careful with WeakReferences.

Vitaly
Accepted, though I would have preferred a more detailed answer on this.
Stephen C
Sorry for this, but I'm trying to figure out the reasons of such behavior on Sun forums now :)
Vitaly
Vitaly, do you have anymore on this now? If you found some information on Sun forums could you post a link? Thanks!
Owen