Am trying to profile a remote tomcat appln which is my staging env. But I am unable to get the profiler tab. Tried googling but I couldnt find the exact issue here.
Both my remote and local jdk versions are same. Both are java 8. Am using visualvm 1.3.8
Profiling of remote application is not supported, please use 'Sampler' tab instead.
Related
I want to create a development environment in which my java application will run in a virtual machine and the code will be written and managed on the host machine.
The java application inside the virtual machine will use DCEVM because I want to use the enhanced class redefinition while remote debugging the application.
The same version of Java(compatible with DCEVM) will be installed on both virtual machine and host machine.
Is there someone who dealt with a similar setup in the past and who can advise whether this setup is feasible or not ?
I am very interested to know whether the remote debug and enhanced class redefinition will work or not in this setup ?
Yes this will work. You can use DCEVM+HotSwapAgent in the virtual machine and connect to it via your remote debugger in IDE in host machine.
I have worked with a similar setup: Tomcat server + Remote debugging in Eclipse for enhanced class redefinition. They were on the same machine, but the setup and configuration is essentially the same.
Refer https://web.liferay.com/web/enrique.valdes.1/blog/-/blogs/java-classes-instant-reloading-using-dcevm-hotswap-agent for steps on how to set this up. It's the same for a Tomcat server.
I am trying to debug Spark application running on eclipse in clustered/distributed environment but not able to succeed.
Application is java based and I am running it through Eclipse. Configurations to spark for Master/worker is provided through Java only.
Though I can debug the code on driver side but as the code flow moves in Spark(i.e call to .map(..)), the debugger doesn't stop. Because that code is running in Workers JVM.
Is there anyway I can achieve this ?
I have tried giving following configurations in Tomcat through Eclipse :
-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=7761,suspend=n
and setting respective port in Debug->remote java application.
But after these settings I get the error: Failed to connect to remote VM. Connection Refused
If anybody has any solution to this, please help.
I was facing the same issue while configuring the spark debugging on remote master. But after that I've installed the spark on my Ubuntu machine then it worked fine. If you really want to debug, my suggestions are
1- configure spark on your testing machine then you can easily debug applications.
2- use IntelliJ IDEA, I've used it for for debugging if I've to use remote spark.
EDITED:
If you are going to use IntelliJ IDEA then you can easily configure remote debugging as explained here. Debugging Apache Spark Jobs
I am trying to debug some memory leaks in my applications on JBoss 7. So I downloaded VisualVM, connected to running JBoss instance on localhost (which already took 5 minutes which si strange). BUT, I don't have the Perform GC option in Monitor section (button is disabled) and the Thread tab is missing completely. It is also the same for other Java applications like NetBeans, only with exception of the VisualVM itself.
I also tried jVisual and it can't event connect to my JBoss server. I've read that this can be caused by some user accounts issues (you can't run VisualVM as root) but I am running all these aplications under my personal account.
Problem has been solved, you need to put visualvm.sh into JBOSS_HOME/bin and run VisualVM from there. Here you can find how to get this file. Then you need to connect through JMX with query like service:jmx:remoting-jmx://{host_name}:{port} (so in my case localhost:9999). That worked for me.
I've had a Spring 3.x application running on Solaris (5.10) in a VMWare VM for quite a while. My application registers some mbeans. I've been able to connect remotely to the VM from VisualVM and view data in the "Monitor" tab, and I've been able to see and manipulate my application mbeans in the MBeans tab.
My server was recently moved to another VMWare VM, although the host name and IP address didn't change. We got it all working, I thought, until I noticed some odd behavior when I tried to connect to the VM from VisualVM on my desktop. When I first tried it, I thought it was working fine, but when I looked closer I noticed that there was no "Monitor" tab, and when I looked at the MBeans tab, it didn't have any of my application mbeans.
I can run a local WebLogic instance, and I don't see these issues when I connect locally with VisualVM.
It doesn't seem like it would be a firewall problem. The connection succeeded. In the "Overview" tab I can see all the basic property settings.
Why would my remote connection have "degraded" functionality?
It looks like your remote is connected to the wrong MBeanServer, which is to say, rather than connecting to the WebLogic Domain Runtime Server, you are connecting to the JVM's platform MBeanServer. I'm not certain, but I think you should be able to connect to any of the three MBeanServers running in the WebLogic instance, as outlined here.
There is also an option to register your Weblogic Domain MBeans in the platform MBeanServer.
I have connected VisualVM via JMX to an AIX server to profile my Java process. But the "Profiler" tab is missing I just get Overview, Monitor and Threads.
Have I missed any configuration? When opening a local Java process I see the "Profiler" tab. Or isn't it possible to profile a remote application?
Which version of VisualVM do you use? "Profiler" tab is not available for remote applications, but you should be able to use "Sampler" tab, which uses JMX connection to do CPU sampling of your remote application.
I'm afraid that's not possible.
From the JVisualVm documentation:
Note. Java VisualVM can retrieve monitoring information on remote applications but it cannot profile remote applications.
You might want to refer to this for remote profiling: Is there a remote profiler for Java? (that uses JMX preferably)