mss / jvmtop

Automatically exported from code.google.com/p/jvmtop
0 stars 0 forks source link

FreeBSD: Thread CPU Time Measurement is not supported #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run jvmtop
2. run jvmtop against pid
3.

What is the expected output? What do you see instead?
information on the pid is expected
java error is found

What version of jvmtop are you using? On what operating system?
0.6.0
FreeBSD 9.1

Please post the output of the following commands:
java -version

[jgh@pepper ~]$ java -version
openjdk version "1.6.0_32"
OpenJDK Runtime Environment (build 1.6.0_32-b27)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

echo $JAVA_HOME  (for unix/linux systems)
/usr/local/openjdk6

Please provide any additional information below.

[jgh@pepper ~]$ ps -wwwwaux |grep java
jgh        54408  4.0  2.0 1285004  80952  2  S+   10:06PM  0:06.34 
/usr/local/openjdk6/bin/java -cp 
/usr/local/share/java/classes/jvmtop.jar:/usr/local/openjdk6/lib/tools.jar 
com.jvmtop.JvmTop
jgh        55258  0.0  0.1   16280   2112  3  S+   10:07PM  0:00.00 grep java
[jgh@pepper ~]$ jvmtop 54408
Exception in thread "main" java.lang.UnsupportedOperationException: Thread CPU 
Time Measurement is not supported.
    at sun.management.ThreadImpl.getThreadCpuTime(ThreadImpl.java:214)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:180)
    at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:114)
    at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:51)
    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:226)
    at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
    at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:251)
    at javax.management.StandardMBean.invoke(StandardMBean.java:405)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:857)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:795)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1475)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1316)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:838)
    at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

I don't know if this is relevant to this source code, but here is a patch that 
worked for another piece of software that fixed an issue with a similar 
exception.

http://weka.8497.n7.nabble.com/Patch-fix-quot-UnsupportedOperationException-Thre
ad-CPU-time-measurement-is-not-supported-quot-on-FrD-td11308.html

Original issue reported on code.google.com by bsd-...@helfman.org on 20 Jun 2013 at 5:12

GoogleCodeExporter commented 9 years ago
Thank you for reporting this. I'll have a look.

The exception should not happen in any case, however it might be possible that 
OpenJDK on FreeBSD does not support thread cpu time retrieval at all which 
means that the detail view will not be able to show the top threads.

The similar patch you suggested (btw thanks for pointing this out) tries to 
enable thread cpu time monitoring which might have no effect in your OS/JDK 
combination.

It would also be interessting if you're able to reproduce this issue with 
jvmtop at an Oracle JDK (running on FreeBSD).

Original comment by patric.r...@gmail.com on 20 Jun 2013 at 6:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Reproduced with Openjdk6 on FreeBSD.

Original comment by patric.r...@gmail.com on 19 Jul 2013 at 8:23

GoogleCodeExporter commented 9 years ago
Should be fixed with 0.7.0.
jvmtop will now longer crash when monitoring a jvm which does not support 
thread cpu time measurement.

@bsd-src@helfman.org
Can you confirm this?

Original comment by patric.r...@gmail.com on 21 Jul 2013 at 8:06

GoogleCodeExporter commented 9 years ago
Confirmed

-jgh

Original comment by bsd-...@helfman.org on 21 Jul 2013 at 10:10

GoogleCodeExporter commented 9 years ago
Thank you!

Original comment by patric.r...@gmail.com on 22 Jul 2013 at 2:37