oracle / oracle/visualvm

Tab 'Threads' doesn't refresh thread names and thread renamings.

Open
#159 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
3.3k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
In threads list in tab 'Threads' threads that have been renamed do not change their names after they had been initially displayed in list.

To Reproduce
Steps to reproduce the behavior:

  1. Write simple application with main(args) method
  2. Start some thread pool with named thread factory setting some %yourPrefix% for thread names and run some tasks to populate pool with threads.
  3. Open VisualVM and go to tab 'threads'. Threads named with the prefix provided in thread factory in step 3 are present in list .
  4. do following thing with your executor:
    executor.execute(() -> Thread.currentThread().setName(%anotherName%));
  5. Return to VisualVM threads list. Name change %yourPrefix% -> %anotherName% would not be displayed in list. As a matter of fact, thread renaming is done, but VisualVM have not refreshed the list. In order to see renaming result, close this particular JVM tab and open it again - new thread name is visible.

Expected behavior
It is expected that thread renaming effect will be displayed in threads list after Thread.setName() invocation.

Desktop (please complete the following information):

  • OS: Windows 10
  • JDK version: 1.8.0_65
  • Version: 1.4.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the VisualVM Threads tab and reproduce the issue with a thread pool whose thread calls Thread.setName(). Trace how the thread list refreshes after the name changes, then verify that the displayed name updates without closing and reopening the JVM tab.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.