Using VisualVM on JBoss application server - java

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.

Related

Glassfish server domain stops running for no obvious reason

I have a glassfish 4 server installed on a Linux server. Apart from the Glassfish server default domain1, I created another domain - domain4.
Domain1 and domain4 have .WAR files of same application deployed on each of them.
But the domain4 keeps stopping for no obvious reason. I have to manually restart it with the 'sh asadmin start-domain domain4' command . This happens several times a day and it's tiring and frustrating to users. The domain1 doesn't have that issue.
I searched for solutions on google and StackOverflow.Most answers pointed to memory issues.
I increased the swappiness of the Linux so it can use more of the virtual memory if it needs more memory. However this did not work .
I asked the web host to increase the RAM from 2GB to 4 GB. This still did not solve the issue.
I undeployed the app from domain4, but the domain still goes down after a while.
I created another domain - domain5 without deploying any app on it. Yet, domain5 still goes down. Which means the problem is not from the app. But domain1 keeps running without issues.
*I even stopped domain1, to see if it was the cause and allowed domain5 to run . But after a while, domain5 still went down.
While monitoring the Linux server memory usage, I noticed the system doesn't even use up to 60% of RAM. The Glassfish server log and glassfish log didn't show any errors that point to any cause.
Does anyone have an idea of what could be the cause of this? Thank you
I created a service for the glassfish domain using the command:
asadamin>create-service domainName
it's been stable now for weeks.

Profile GAE application in local dev server with VisualVM

I have an app that consumes so much memory, I would like to profile it, but I'm unable to start the app and pass the argument -agentpath; after I add this argument it waits for the profiler to connect, and so the GAE application doesn't startup. I get this message
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 15)
I'm using maven to start up GAE application.
Sample command to start up:
java -agentpath:C:/visualvm_139/profiler/lib/deployed/jdk16/windows-amd64/profilerinterface.dll=C:\visualvm_139\profiler\lib,5140 -javaagent:C:\Users\User\.m2\repository\com\google\appengine\appengine-java-sdk\1.9.59\appengine-java-sdk\appengine-java-sdk-1.9.59\lib\agent\appengine-agent.jar -Dappengine.fullscan.seconds=5 -classpath C:\Users\User\.m2\repository\com\google\appengine\appengine-java-sdk\1.9.59\appengine-java-sdk\appengine-java-sdk-1.9.59\lib\appengine-tools-api.jar com.google.appengine.tools.development.DevAppServerMain -p 8888 C:\Users\User\eclipse\workspace\App\
An alternative solution would be using;
-Xdebug
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y
which would block the app until a debug client is attached on port 8000.
If you are having trouble using VisualVM with App Engine, you can try another approach, such as using Stackdriver to monitor different aspects of your Java VM, such as memory usage.
This link has all the useful information on how to set up a Stackdriver agent and use its monitoring functions to determine where the memory leaks come from.
If you don't need to profile startup of your application (from the description it looks like you don't), just start your application normally (without -agentpath). Start VisualVM, open your application and go to Profiler tab.
if you need to profile startup of your application use Startup profiler. It will tell you, what you should do.

Worklight server hangs for local desktop development

I am working with worklight on Eclipse on a windows machine. I can never get it to stop or restart properly. Normally I have to spend 5 minutes trying to delete the server and add back the worklight projects and then it may startup again. Has anyone experienced this and what is a fix?
When I start Worklight server (local machine), the server just hangs, the bottom right message displays "Starting Worklight Developer Server".
I am using:
Launching worklight (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130524-0951) on Java HotSpot(TM) 64-Bit Server VM, version 1.6.0_30-b12 (en_US), Worklight Studio / 6.1.0.01 - 2014
Version: Kepler Service Release 2
Build id: 20140224-0627
Code Base: nothing really, just a simple HelloWorld Adapter and javascript client code.
There are no error messages, this is the last message in the console.
CWWKZ0001I: Application _MobileBrowserSimulator started in 0.498 seconds.
When visiting the server in the browser, there is no response because it looks like the server is still trying to start.
I usually wait 5 minutes before killing the server in the task manager. Even after killing the server in the task manager and then closing Eclipse and trying to start the server again...the server still hangs. Normally, I end up deleting the server and creating another one.
Note: I see a potential issue with the mobile simulator application, but when I remove the mobile simulator, worklight seems to inject it back into the server.
Edit-1: Nothing has really worked. I am now using Kepler SR1 and new workspace. It is possible that the server hanging issue has died down but it still happens. Basically, the only way to kickstart the worklight server is to change the server.xml, delete all the wars/applications (all 2 of them) and then kill the server in the task manager, possibly restarting eclipse and then starting the server again. There are no errors in the message log.
It's hard to say what might be wrong with just that information. Can you provide your messages.log file when the server has failed? (It should be under workspace_path/WorklightServerConfig/servers/worklight/logs)
The best way to get the real one we want, would be to use a fresh Eclipse workspace and then reproduce the problem.
Just blinded eyes, as a potential solution, I would try to set a valid IP to the Worklight Development Server, instead using "localhost" which is the default. Have you tried that? In Servers View, double click Worklight Development Server -> Host Name -> SET TO YOUR CURRENT IP. Then do a Run As -> Run on Worklight Development Server again for your application.
Kepler SR2 isn't supported for Worklight 6.1x. I don't know if this is the cause, but there was some unpredictable behavior with SR2. I would suggest trying it on Kepler SR1 and see if you get the same behavior. Get links to supported eclipse releases and editions here: https://www.ibm.com/developerworks/mobile/worklight/download/

Tomcat7 detect Memory Leak

I have made a simple application using vaadin 6 witch contains a callendar and people can make some appointments in there.
The problem is, when more then like 10 people connects, the memory usage is 95%.(I have 125mb on server, running Ubuntu Server 32 bit).
Here are the screenshots:
If I enter tomcat and test if fomr memory leaks i get:
The following web applications were stopped (reloaded, undeployed), but their
classes from previous runs are still loaded in memory, thus causing a memory
leak (use a profiler to confirm):
/myapp
/myapp
/myapp
/myapp
/myapp
When I installed tomcat I just made a clean install, and changed the ports so i can connect to it on port 80, also I have added some users so I can connect to web manager. THat is all
Can there be something in my code or I did not set up tomcat correctly that causes this memory leak?
Your getting this because static variables. When you are restart your server or application the static variables will not unload some time. This link will help you to understand about this:http://frankkieviet.blogspot.ca/2006/10/classloader-leaks-dreaded-permgen-space.html

After moving server to new VM, VisualVM remote connection can't see Monitor tab or application mbeans

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.

Categories

Resources