• Bug
  • Status: Open
  • 2 Major
  • Resolution:
  • prodmgmt
  • Reporter: foshea
  • June 28, 2007
  • 0
  • Watchers: 0
  • March 19, 2010

Description

Orion was describing forr me yesterday a very subltle potential problem for DSO users. The essence of it is that if user code has a java.lang.ref.Reference to a shared object Foo, Foo can be paged out of memory by the DSO reaper. The reference will be nulled out.

This behavior may be surprising to some user code - the expectation is that the reference value won’t become null until the object has entered some phase of the garbage collection cycle.

Ideally, it seems we should solve this by either

1) paging in/out of managed references in exactly the same way we do for strong references (preferable)

or

2) never reaping anything that has a soft reference to it ((less preferable, possibly somewhat dangerous)

Either solution would involve some fairly intense hacking that is not very well understood at this point.

I don’t think we need to fix this in the near term. My sense is that this is a pretty small corner case, at least for application developers - they don’t use reference objects very much at all, and 80% of their uses are going to be WeakHashMap-type things.

We are probably a bit more likely to run afoul of container code (e.g. WLS), though. We’ll just have to keep our eyes peeled for problems there.

However, even though we don’t need to fix this, I would like to get a technical doc note about this somewhere, maybe in an appendix of technical notes.

Comments