Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4038438

strong references in registry prevent unreferenced() from being invoked

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Server objects which are bound in the rmi registry "count" as live
      remote references to the server object. This renders the use of the
      unreferenced() method on the server object meaningless. The unreferenced()
      method will only be invoked when the reference count of the server object
      drops to 0; and this will never happen as long as the object is
      bound in the registry.

      This means that the server object can never be garbage collected locally.
      And there is no logical place/time to unbind the object from the registry.

      For example, the following scenario has been posed:

      - a client requests some resource for an object
      - the resource determines that the object is a shared object that has not yet
        been instantiated
      - the resource creates a new JVM and causes the required object to be
        instantiated in the new JVM
      - the resource returns the object reference to the client and stores the object
        reference in the registry so that if other clients request to access the
        existing shared object the resource can return the reference to them
      - the original requesting client goes away (possibly through failure)

      The problem is that there is no way to clean up the the shared object (and maybe
      its JVM) since the remote reference count will never get to zero (the registry
      entry always keeps this above 0).

      At the least, this behavior should be documented more clearly.

        Attachments

          Activity

            People

            Assignee:
            awollratsunw Ann Wollrath (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: