问题
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
回答1:
at window prompt, run echo %TMP%, it will give you default temp dir. Go to that directory and find directory named hsperfdata_ where 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
回答2:
I have the same problem. But if I explicitly specify the PID, as in jconsole 1234
, jconsole is able to analyze the process.
回答3:
If you are running jconsole on windows - simply :
- Find jconsole.exe
- Right click it
- Select run as administrator.
回答4:
In my case, removal of hsperfdata_USERNAME
directory (in %TMP%
directory) and closing all the JVMs has helped.
回答5:
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.
回答6:
You have to start jconsole with the same user as the process you want to analyze is started by.
来源:https://stackoverflow.com/questions/13746640/jconsole-cant-find-process