Показаны сообщения с ярлыком jvisualvm. Показать все сообщения
Показаны сообщения с ярлыком jvisualvm. Показать все сообщения

среда, 8 октября 2014 г.

Poor`s man jvisualvm on Windows 2008+

If running java processes as services on Windows 2008 and later, there is no way to profile them using jvisualvm - you can`t connect to them directly.

Yes, you can use - jmx, jstatd. But there is a way to gather performance data without all that fuzz.

Using psexec (from SysInternals) you can dump all performat data for all java processes with one command line:

psexec \\HOST -accepteula -u DOMAIN_USER -p DOMAIN_PASSWORD -h cmd /c for /f "tokens=1" %i in ('%JAVA_HOME%/bin/jps.exe') do jcmd %i PerfCounter.print

It uses jcmd for dumping all information. You must use the same DOMAIN_USER, DOMAIN_PASSWORD used for services. Do not run java services as LocalSystem!

This will produce output like this: