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

NMT: summary diff reports threads count incorrectly

    XMLWordPrintable

Details

    • b14
    • b20

    Backports

      Description

        Apparent regression after JDK-8204552 fix.
        Amount of threads reported incorrectly for summary and detail diff when used by jcmd. During comparison to baseline threads amount is always reported as 0 on non-AIX platforms:
        $ jcmd <PID> VM.native_memory baseline
        $ jcmd <PID> VM.native_memory summary.diff
        ...
        Thread (reserved=23622KB +1027KB, committed=1358KB +107KB)
                      (thread #0)
                      (stack: reserved=23552KB +1024KB, committed=1288KB +104KB)
                      (malloc=45KB +2KB #142 +6)
                      (arena=25KB +1d #44 +2)
        ...
        This is happening because ThreadStackTracker::track_as_vm() condition is ignored during MallocMemorySnapshot collection and thread count is always reported as malloc count of allocations for mtThreadStack:
        inline size_t thread_count() const {
         MallocMemorySnapshot* s = const_cast<MallocMemorySnapshot*>(this);
         return s->by_type(mtThreadStack)->malloc_count();
        }
        MallocMemorySnapshot::thread_count() should consider ThreadStackTracker::track_as_vm().
        Issue is not reproducible if ThreadStackTracker::track_as_vm() == false.

        Attachments

          Issue Links

            Activity

              People

                eignatenko Evgeny Ignatenko
                yan Yuri Nesterenko
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: