Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-3922

Reducing contention on java.lang.Throwable#getOurStackTrace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.24.0
    • 2.25.0
    • None
    • None

    Description

      This is a request for improvement rg. performance in a very specific case, but easy to accomplish.

      Scenario

      On certain contaier'ed Windows machines we have identified that java.lang.Throwable#getOurStackTrace along with java.lang.StackTraceElement#initStackTraceElements show up as a very expensive operations. The reason behind this is still unclear, but since the #getOurStackTrace is synchronized, it suffers even more when the native method #initStackTraceElements takes an unexpected long time.

      This shows in thread-dumps in 2 locations for Artemis, where connection-creation is the more crucial one from my pov.

      See attached threads.txt

      Remedy

      Fortunately the location where this gets used via Thread.currentThread().getStackTrace() is simple to replace, since the information needed could just get passed by caller.

      Please see attached patch for my proposal.

      Also available here as commit.

      Can create a pull request as well.

      Attachments

        1. threads.txt
          5 kB
          Rico Neubauer

        Issue Links

          Activity

            People

              Unassigned Unassigned
              riconeubauer Rico Neubauer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h