hk2
  1. hk2
  2. HK2-130

ServiceLocatorImpl is not disposed on shutdown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: None
    • Labels:
      None

      Description

      It can be easily seen with hk2-config/ConfigDisposalTest, set breakpoints in before() on line 33 after habitat is initialized, and on second break see with VisualVm (Sampler - Memory - Heap Dump - OQL Console) two ServiceLocatorImpl instances, but only one is expected. OQL is: select x from org.jvnet.hk2.internal.ServiceLocatorImpl x

        Activity

        Hide
        jwells added a comment -

        Is this still true?

        Show
        jwells added a comment - Is this still true?
        Hide
        andriy.zhdanov added a comment -

        Yes, but may be not important.

        Show
        andriy.zhdanov added a comment - Yes, but may be not important.
        Hide
        jwells added a comment -

        Fixed. The problem was WriteableView was doing some static initialization that was keeping a hold of the first instance of WriteableView created. That is no longer the case. After running the entire suite only one service locator is available at the end, which is what was expected.

        In the end I discovered the root cause of the problem using jprofiler, which was a lot more useful than VisualVM.

        Show
        jwells added a comment - Fixed. The problem was WriteableView was doing some static initialization that was keeping a hold of the first instance of WriteableView created. That is no longer the case. After running the entire suite only one service locator is available at the end, which is what was expected. In the end I discovered the root cause of the problem using jprofiler, which was a lot more useful than VisualVM.

          People

          • Assignee:
            jwells
            Reporter:
            andriy.zhdanov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: