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

ThreadService get_live_thread_count/get_daemon_thread_count

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: tbd_major
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      svc

      Description

      _exiting_threads_count, _exiting_daemon_threads_count, _daemon_threads_count, _live_threads_count
      These four variables are changed together under Threads_lock, but we read them without Threads_lock.

      get_live_thread_count/get_daemon_thread_count sometimes return a negative value, e.g if you first load _daemon_threads_count => several threads then starting to exiting, when you load _exiting_daemon_threads_count it can be larger, and we return a negative number.

      TEST FAILED: Minimal number of daemon thread count is 21ThreadMXBean.getDaemonThreadCount() returned 15
      TEST FAILED: Minimal number of daemon thread count is 21ThreadMXBean.getDaemonThreadCount() returned 15
      TEST FAILED: Minimal number of daemon thread count is 0ThreadMXBean.getDaemonThreadCount() returned -6
      TEST FAILED: Minimal number of daemon thread count is 0ThreadMXBean.getDaemonThreadCount() returned -6
      TEST FAILED: Minimal number of daemon thread count is 0ThreadMXBean.getDaemonThreadCount() returned -6
      TEST FAILED: Minimal number of daemon thread count is 0ThreadMXBean.getDaemonThreadCount() returned -6

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                asapre Amit Sapre
                Reporter:
                rehn Robbin Ehn
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: