JConsole can't find process

2019-04-04 00:59发布

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

标签: jconsole
6条回答
一夜七次
2楼-- · 2019-04-04 01:10

I have the same problem. But if I explicitly specify the PID, as in jconsole 1234, jconsole is able to analyze the process.

查看更多
不美不萌又怎样
3楼-- · 2019-04-04 01:16

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.

查看更多
Animai°情兽
4楼-- · 2019-04-04 01:24

You have to start jconsole with the same user as the process you want to analyze is started by.

查看更多
smile是对你的礼貌
5楼-- · 2019-04-04 01:26

In my case, removal of hsperfdata_USERNAME directory (in %TMP% directory) and closing all the JVMs has helped.

查看更多
手持菜刀,她持情操
6楼-- · 2019-04-04 01:28

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

查看更多
smile是对你的礼貌
7楼-- · 2019-04-04 01:30

If you are running jconsole on windows - simply :

  1. Find jconsole.exe
  2. Right click it
  3. Select run as administrator.
查看更多
登录 后发表回答