# FAQ

Why cannot I find any JVMs on JVM Explorer?

Why do I get the message "Monitoring is not supported for the selected JVM"?

How can I enable the BCI mode of CPU profiler on remote host?

How can I monitor my application that runs only for very short time?

## Why cannot I find any JVMs on JVM Explorer?

At least one JVM (Eclipse itself) should be shown on JVM Explorer. If no JVM is shown, there are two possible causes.

cause 1) Eclipse is not started with supported JDK. For example, JRE might be used instead of JDK.

To solve the issue,

1. Check the value of system property java.home with Help > About Eclipse > Installation Details > Configuration. You may see that the supported JDK is not specified to java.home.
2. Close Eclipse.
3. To enforce using a desired JDK on Eclipse, specify the option -vm to the eclipse executable, or alternatively specify it in eclipse.ini. See the Workbench User Guide to learn how to specify that option.
4. Start Eclipse.

Note: If failed to specify -vm option or if you don't want to change the eclipse launch settings, you may try specifying the JDK on preference page Window > Preferences > Java > Monitor > Tools > JDK Root Directory.

cause 2) The folder %TMP%\hsperfdata_* could be not permitted for JVM to create a new file on Windows.

To solve the issue,

- Change the security settings for that folder,
- Or alternatively set TMP environmental variable to writable directory.

Note: After changing settings, not only your application but also Eclipse have to be restarted.

## Why do I get the message "Monitoring is not supported for the selected JVM"?

There are several cases that this message is shown.

- If you see the additional message "Agent JAR loaded but agent failed to initialize", giving the following JVM option to target JVM may solve the issue.

          -Dcom.sun.management.jmxremote

- If you see the additional message "Unable to attach to 32-bit process running under WOW64", your application is running with 32bit Java while using 64bit Eclipse on Windows. Either using 64bit Java for your application or using 32bit Eclipse solves the issue.
- If you see the additional message "Unable to attach to 64-bit process", your application is running with 64bit Java while using 32bit Eclipse on Windows. Either using 32bit Java for your application or using 64bit Eclipse solves the issue.
- If you see the additional message "The VM does not support the attach mechanism", your application might be running with unsupported Java version (e.g. Java 1.5). Using Java 1.6 or 1.7 for your application solves the issue.
- If you see the additional message "Unable to open socket file: target process not responding or Hotspot VM not loaded", either your application didn't respond creating a socket file like /tmp/.java_pid1234 (e.g. due to hangup, file system permission), or JVM Monitor was not able to find the created socket file (e.g. due to the bug 7009828).
- If you see the additional message "No providers installed", JDK root directory specified on preference page doesn't match with JDK with which Eclipse is started. See the previous question for the procedure to start Eclipse with supported JDK. After changing JDK root directory on preference page, Eclipse has to be restarted.
- If you see error message "Could not open PerfMemory" on Error Log view on Windows, the directory %TMP%\hsperfdata_* is not permitted to create a new file. See the previous question for the solution.
- If you don't see any additional message, your application might be shut down in the meantime.

## How can I enable the BCI mode of CPU profiler on remote host?

To enable BCI mode of CPU profiler on remote host,

1. Find the agent file jvmmonitor-agent.jar at plug-ins instalation directory.

           <plug-ins instalation directory>/org.jvmmonitor.core/lib/jvmmonitor-agent.jar

2. Copy the agent file to arbitrary directory on remote host.
3. Start your application on remote host with the following options.

           -javaagent:<path>/jvmmonitor-agent.jar

Note: When you upgrade the version of JVM Monitor, jvmmonitor-agent.jar has to be copied again.

Note: If you use JDK/JRE 6, white space cannot be contained in the path due to the bug 6459832

## How can I monitor my application that runs only for very short time?

To monitor the application that runs for so short time that you cannot connect JVM Monitor,

1. Set a break point at point of interest, and run your application with debug mode.
2. Connect JVM Monitor to the application while stopped at break point.
3. Collect profiling data with JVM Monitor.

Note: If your application is started from outside Eclipse, you may specify the following option for your application to suspend until debugger is attached.

        -agentlib:jdwp=transport=dt_socket,address=<port number>,server=y,suspend=y