3

I am running a java program from inside IntelliJ IDEA (an IDE) on a Mac. The program spawns 2 threads.
I have installed htop and I am trying to see the process along with the spawned threads (they are assigned specific names from the code).
The problem is that although I can find the pid (which I have printed from the java program), the individual threads are not displayed.

I have enabled thread views in htop, by pressing F2 to enter htop setup menu and chose "Display option" under "Setup" column, and toggle on "Tree view" and "Show custom thread names" options.

I.e. when doing htop -p $pid it shows only an entry for the IntelliJ process. How is this possible?

Update:
When running the program from the command line with java -jar the threads are not visible either

1 Answer 1

0

On MacOS, htop needs superuser permissions to access threads info. Run sudo htop and threads will be visible.

Verified on MacOS 15.6

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.