Reputation: 323
I am trying to profile a simple java application using jvisualvm on Windows 7 64 bit. I am using Java 8 with JDK 1.8.0_131. I am able to see my application and use the Sample tab of VisualVM, however when I use the CPU option of the Profile tab I get a "Redefinition failed with error 62". This error is documented online and the common solution is to include the flag -Xverify:none when launching the application. However, using this flag has no effect for me. I have tried it with both the JVisualVM itself and my simple program jar neither makes a difference. Below are the terminal commands I am using.
Using Xverify with the simple program.
java -jar SimpleProfile.jar -Xverify:none
Using Xverify with jvisualvm
./jvisualvm.exe -J-Xverify:none
Both were run from a Git Bash terminal with not effect. I have tried comparable commands in CMD as well.
I do not have admin privileges on my PC and I noticed that I cannot use the Windows resource monitor. Is this possibly related to the issue or is there something wrong with my arguments?
Extra info: When the profiler fails I get the following error in terminal
Profiler Agent: Waiting for connection on port 5140 (Protocol
version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent Error: Redefinition failed for classes:
sun.nio.fs.NativeBuffer$Deallocator
sun.rmi.transport.DGCImpl$1
sun.rmi.transport.tcp.TCPTransport$AcceptLoop
sun.rmi.transport.DGCAckHandler$1
com.profiletest.Main
sun.nio.ch.FileChannelImpl$Unmapper
java.io.DeleteOnExitHook$1
java.util.ResourceBundle$RBClassLoader
java.util.concurrent.ThreadPoolExecutor$Worker
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask
java.lang.ref.Reference$ReferenceHandler
java.lang.ClassLoader
java.util.logging.LogManager$Cleaner
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout
java.lang.ApplicationShutdownHooks$1
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler
java.util.concurrent.FutureTask
java.lang.ref.Finalizer$FinalizerThread
java.lang.reflect.Method
Profiler Agent Error: with message: Redefinition failed with
error 62
Check JVMTI documentation for this error code.
Debug: writing class file: sun.nio.fs.NativeBuffer
$Deallocator, into file: sun.nio.fs.NativeBuffer
$Deallocator.class
Debug: writing class file: sun.rmi.transport.DGCImpl$1, into
file: sun.rmi.transport.DGCImpl$1.class
Debug: writing class file:
sun.rmi.transport.tcp.TCPTransport$AcceptLoop, into file:
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.class
Debug: writing class file: sun.rmi.transport.DGCAckHandler$1,
into file: sun.rmi.transport.DGCAckHandler$1.class
Debug: writing class file: com.profiletest.Main, into file:
com.profiletest.Main.class
Debug: writing class file: sun.nio.ch.FileChannelImpl
$Unmapper, into file: sun.nio.ch.FileChannelImpl
$Unmapper.class
Debug: writing class file: java.io.DeleteOnExitHook$1, into
file: java.io.DeleteOnExitHook$1.class
Debug: writing class file: java.util.ResourceBundle
$RBClassLoader, into file: java.util.ResourceBundle
$RBClassLoader.class
Debug: writing class file:
java.util.concurrent.ThreadPoolExecutor$Worker, into file:
java.util.concurrent.ThreadPoolExecutor$Worker.class
Debug: writing class file:
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask, into file:
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.class
Debug: writing class file: java.lang.ref.Reference
$ReferenceHandler, into file: java.lang.ref.Reference
$ReferenceHandler.class
Debug: writing class file: java.lang.ClassLoader, into file:
java.lang.ClassLoader.class
Debug: writing class file: java.util.logging.LogManager
$Cleaner, into file: java.util.logging.LogManager
$Cleaner.class
Debug: writing class file:
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout,
into file:
com.sun.jmx.remote.internal.ServerCommunicatorAdmin
$Timeout.class
Debug: writing class file:
java.lang.ApplicationShutdownHooks$1, into file:
java.lang.ApplicationShutdownHooks$1.class
Debug: writing class file:
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler, into
file: sun.rmi.transport.tcp.TCPTransport
$ConnectionHandler.class
Debug: writing class file: java.util.concurrent.FutureTask,
into file: java.util.concurrent.FutureTask.class
Debug: writing class file: java.lang.ref.Finalizer
$FinalizerThread, into file: java.lang.ref.Finalizer
$FinalizerThread.class
Debug: writing class file: java.lang.reflect.Method, into
file: java.lang.reflect.Method.class
Upvotes: 4
Views: 2921
Reputation: 323
java -Xverify:none -jar SimpleProfile.jar works. I guess I hadn't exhausted all the options.
Upvotes: 5