Reputation: 291
I tried to run JConsole to analyze the memory used by a running process, but JConsole doesn't show me processes even though I am absolutely sure that one is running (in addition to that it should show JConsole in the process list as well but it doesn't).
Does anyone have an idea why it doesn't show any processes?
Cheers
Upvotes: 21
Views: 16238
Reputation: 361
8 years later... I had the same problem. I could only see certain processes but couldn't see and monitor any java processes running in a docker container in Linux.
Inspired by the Windows solution by RoyalBigMack:
su
command) and run jconsole
sudo jconsole
Only the first solution worked for me, and once the jconsole UI popped up- all the hidden processes were now visible.
Upvotes: 1
Reputation: 179
at window prompt, run echo %TMP%, it will give you default temp dir. Go to that directory and find directory named hsperfdata_user where user is your login. This is directory to store your process id. Any new process you created such as java application will have a new file named by process id. Jconsole will pick up the process ids from this directory. If you cannot create a file in this directory, that means you need change permission to allow write. Once done that, start a new java application to see if new process id file is in the dir. Once confirmed, start jconsole
Upvotes: 17
Reputation: 1152
Just ran into this issue
If you are using multiple jdk's by any chance (ex. SDKMAN), then make sure that jconsole
is run using the same jdk as the application
Upvotes: 1
Reputation: 716
If you are running jconsole on windows - simply :
Upvotes: 9
Reputation: 2997
You have to start jconsole with the same user as the process you want to analyze is started by.
Upvotes: 1
Reputation: 572
In my case, removal of hsperfdata_USERNAME
directory (in %TMP%
directory) and closing all the JVMs has helped.
Upvotes: 3
Reputation: 1124
This happens when %TMP% value is different for monitored JVM and the monitoring tool (JConsole/JMC/Java Mission Control, maybe even VisualVM). This may be the standard scenario with Cygwin (at least in my case: Cygwin+Babun) Easiest solution is to set value of the TMP environment variable to the default value used by Windows, at least in scope of shell launching the JVM.
Upvotes: 1
Reputation: 181
I have the same problem. But if I explicitly specify the PID, as in jconsole 1234
, jconsole is able to analyze the process.
Upvotes: 14