JProfiler: why can't I attach to running JVM? - jprofiler

I just downloaded JProfiler and tried to connect to a remote JVM.
When I click "OK" I get an error message saying:
"Another application is listening on port 8888. Please check your port configuration".
I also succeeded to profile this machine with 8888 with Java Mission Control (JMC). However, JMC asked me for a username and password and only then allowed the connection.

JProfiler does not use JMX to connect to a profiled JVM, it uses its own protocol. Also, you can only use the attach mode in your screen shot if the profiling agent is already loaded. You would either have to start the profiled JVM with the -agentpath=... VM parameter as given by "Session->Integration Wizards->New Remote Integration" or run the command line tool bin/jpenable on the remote machine to prepare a selected process for profiling. This will tell you the port you have to connect to.
Alternatively, you can use the "quick attach" feature in the start center to connect to any remote unrprofiled JVM through SSH. Then you do not have to prepare the JVM for profiling.

If you use the JProfiler in local Windows machine ,may be you can try run the jprofiler.exe and then click "session - Start center - Quick Attach ",then pick the Process Name that associated to your program.

Related

Loadrunner not allowing to connect to a telnet host in RTE recording

I have used loadrunner 12.53 in my previous machine and had connected to a telnet host for recording without any issues.
But I recently downloaded 12.55 community edition in my new machine. When I give the host name and terminal type as before, it says "unable to connect to host".
I don't have any idea why it is showing this. The installation was done the same way as before. The telnet application also didn't change recently. Can you suggest what could be the problem?

HLK Studio does not show my driver in selection tab

I am trying to do HLK testing for my own driver by this instruction https://msdn.microsoft.com/ru-ru/library/windows/hardware/dn915002(v=vs.85).aspx , but I have problems.
I can not do step 5 as I do not see my driver in the list of .sys files I can select for testing in HLK Studio selection tab.
My driver is stored on test machine in location C:\MyDriver\mydriver64.sys. It is 64-bit kernel mode driver used by my application for RAM analysis.
What can I do to add my driver to the selection list and run HLK tests for it?
Thank you.
Make sure the driver is running on the machine
Make sure the machine status is set to ready.
Restart the HLK service on client. (go to services, search for hlk, R-click, restart)
Restart the HLK service on server. (same as client)
Check the machine status again, give it some minutes to get ready
If still not working, try restarting both systems
Sometimes HCK Infrastucture Service crashing, but HLK Communication service still works. You need restart HCK Infrastructure service too. On my job, we had a problem with very long start time of this service and Windows throws timeout error for service start. Because of this, service never starts. We solved this problem, by setting bigger time for service start in Windows registry.
Registry key is HKLM\SYSTEM\CurrentControlSet\Control\ServicesPipeTimeout
Make sure the driver is running on the test machine.
Start "HLK Manager", click on "My Machines..."
Select your test machine from the list, right click, "change-status" to "unsafe"
Open "HLK Studio" ... "Configuration"
Find your test machine, right click, "change machine status" to "ready"
Load your project and check for your driver under "Selection"
What kind is your driver? Please provide your inf file or registry entry.
Do you search it under "software device" or "device manager"?
Be sure to
install driver prior to client
start driver
select software device in Studio's Selection tab
I was looking for my driver in "device manager" which was the default and not finding it as it is a driver hence software. Spent far more time on that problem than I'd like to admin
Restart Client Machine
Restart HLK Communication service.
Restart HLK Infra Service.
Now try to load the machine pool, Issue should have resolved now.

Monitoring Storm JVM metrics

I have got a storm cluster running and I want to monitor its performance. I followed this blog and was able to measure the number of tuples received by a bolt using codahale metrics and display it in graphite.
My goal is to deploy a storm cluster on a lightweight computer such as beaglebone and for that I need to be able to monitor JVM parameters such as CPU, thread and memory usage of each Worker Process.
I really like codahale metrics and would like to continue using it in my application. Can anyone direct me as to how I can measure JVM parameters separately for each worker using codahale metrics?
I would really appreciate it if someone posted an example of how to get jvm metrics using codahale metrics.
Thanks,
Palak
I found an excellent tutorial here. Works like a charm.
Using VisualVM and JMX we can get the CPU usage,GC activity, class loading information, Heap size & Used Heap statistics, All the Threads information with statistics,
CPU & Memory profiling, performance monitoring, Memory leaks of worker nodes. And also you can take heap dumps and thread dumps, profiler snapshots.
STEPS for setup
STEP 1: Staring VisualVM
Java VisualVM is bundled with JDK version 6 update 7 or greater. Navigate to your JDK software's bin directory and double-click the Java VisualVM executable.
Alternatively, navigate to your JDK software's bin directory and type the following command at the command (shell) prompt: jvisualvm.
STEP 2: Adding MBean plugin
For JMX monitoring you need to add MBean plugin explicitly.
1, Choose Tools > Plugins from the main menu.
2, In the downloaded Plugins tab, Click Add Plugins
3, Select the Mbean plugin
After successfully adding MBean plugin you can see MBean tab in VisualVM and you can monitor JMX.
STEP 3: Local Monitoring
By default VisualVM will monitor all the applications running on the local JVM. No need to do any changes if your using Java 1.6 and above.
STEP 4: Remote Monitoring
To retrieve and display information on applications running on the remote host, the jstatd utility needs to be running on the remote host.
Steps to run jstatd
The jstatd tool is an RMI server application that monitors for the creation and termination of instrumented HotSpot Java virtual machines (JVMs) and provides an
interface to allow remote monitoring tools to attach to JVMs.
1, create a file with "jstatd.all.policy" file name and copy the below content
grant codebase "file:${java.home}/../lib/tools.jar" { permission java.security.AllPermission ;};
2, copy "jstatd.all.policy" file in java bin (Java\jdk1.7.0_10\bin) directory
3, Navigate to your JDK software's bin directory and type the following command at the command prompt: jstatd -J-Djava.security.policy=jstatd.all.policy.txt
4, to run jstatd admin privileges required, then only all the other users can connect it remote host.
It’s one time activity. (Run with background process in CIT and SIT)
To add a remote host in VisualVM, right-click the Remote node in the Applications window,
choose Add Remote Host and type the host name or IP address in the Add Remote Host dialog box.
When Java VisualVM is connected to a remote host, a node for the remote host appears under the Remote node in the Applications window.
You can expand the remote host node to view the applications running on the remote host.
Use jvisualvm.exe jdk/bin and you can monitor storm workers.
Jvisualvm can also point to remote Storm topology.
Download and add mbean plugin into jvisualvm.

Remote Profiling Jprofiler

Hi i am very new to Jprofiler & Linux.
I am trying to Monitor my Apache Tomcat server installed on a linux machine from Jprofiler remote profiling which is installed on windows machine. Kindly help me in the procedure in detail.
I tried all the Help i could get from google but still stuck..any help will is appreciated. Thanks in advance.
In any case, you should extract the JProfiler tar.gz file for Linux on the remote machine. No further configuration is required on the remote side. On the local side you need a full installation of JProfiler.
There are two ways to get remote profiling to work:
A. Attach to the running Tomcat process
Execute the command line utility bin/jpenable in the JProfiler distribution on the remote machine and select the Tomcat process. The JVM will then be ready for profiling. If the profiled JVM is not listed, execute jpenable as the same user that runs the Tomcat JVM. If that does help, use alternative B.
On the local machine, create a session of type "Attach to profiled JVM (local or remote)", specify the host name of the remote machine and the profiling port that was set with jpenable.
When you start session, the JProfiler GUI will connect to the remote machine and you will see profiling data.
B. Use the integration wizard
Execute the command line uutility bin/jpintegrate in the JProfiler distribution on the remote machine and select your application server and follow the subsequent steps.
Then, proceed as in alternative A. This option is actually preferable to alternative A and unless you have to profile an already running JVM, you should take this route.

jvisualvm doesn't list certain Java processes

I want to get a heap dump (suspected memory leak) of a certain Java process. However, when I start the jvisualvm tool, I cannot see any of the running Java processes.
I have Google'd around about this and have already found a couple of articles saying that you have to run the Java processes using the same JDK that you start the jvisualvm tool with in order for it to be able to see them. However, as far as I can see, this is already the case. I'm doing everything locally (I have remote access to the machine).
A couple of things to consider:
The processes are running on a firewalled Windows 2008 server
The processes are running using renamed versions of the JDK java.exe executable
As far as I can see the processes are running using the 1.6.0_18 JDK
One of the running processes starts an RMI registry
I'm waiting on a virtualized copy of the server so I can mess around with it (this is a production server). But in the meanwhile; any ideas as to why I cannot see any of the processes in jvisualvm (or jconsole for that matter)?
Well after I did a little research, it would appear that Peter's comment was correct. Because the JVM processes were launched by another user (the NETWORK SERVICE account because they were being started by a Windows service) they didn't show up in jvisualvm.
Workaround
Since I have access to the application configuration, I have found the following workaround, which involves explicitly enabling unsecured JMX for the target JVM:
Add the following JVM parameters:
-Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Add the remote process to jvisualvm using JMX by click File -> Add JMX Connection. You can connect to the process using port 3333. Obviously you can change the port if you want.
Link to article explaining this in a little more detail: http://download.oracle.com/javase/6/docs/technotes/guides/visualvm/jmx_connections.html
Notes
It's probably not a good idea to keep the JVM settings permanently, as they would allow anyone to connect to the JVM via JMX.
You can also add authentication to the JMX JVM parameters if you want to.
The simplest way is to execute jvisualvm as administrator (win: "run as administrator"). Which is not ideal but works. All java processes are visible then.