hk2
  1. hk2
  2. HK2-177

HK2 high cpu utilization on DI

    Details

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

      Description

      Hi,

      I've noticed very high CPU consumption and very high object allocation rates while using jersey 2.4+ with HK2 (b28 - I've noticed this behaviour on version 22-28). I've narrowed this problem to method:

      org.jvnet.hk2.internal.Utilities.getInjectAnnotation() 98.546394 436,850 ms (98.5%) 21,055 ms

      which in my simple test case (jersey with single resource on embedded container) took over 80% of time spent in application (notice that there are no logic implemented at all). Also I have noticed that enormous amounts of Annotation[] arrays are created during the process.

      Please see attached screenshot: http://i.imgur.com/HT8qTtU.jpg

        Activity

        Hide
        jwells added a comment -

        I have put in a partial fix for this, but I'd like to see how it does in Jersey before closing this bug

        Show
        jwells added a comment - I have put in a partial fix for this, but I'd like to see how it does in Jersey before closing this bug
        Hide
        jwells added a comment -

        Have not seen any requests from Jersey about this recently...

        Show
        jwells added a comment - Have not seen any requests from Jersey about this recently...

          People

          • Assignee:
            jwells
            Reporter:
            mateusz.gajewski
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: