top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Local VisualVM connection to Tomcat

0 votes
354 views

I am constantly encountering PermGen errors despite quite high PermGen limit (even 512m) and many options set - approx once a week under not heavy load.

I am trying to investigate what the app causes this, but I haven't succeeded in reproducing it locally yet.

I found several articles about VisualVM (I hope it could help me to determine some PermGen issues) and connecting it to the Tomcat. Remotely. But I have no clue how can I conect the local VisualVM to tomcat that runs on localhost.

Even here it is written:
http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html

Enabling JMX Remote
Note: This configuration is needed only if you are going to monitor Tomcat remotely. It is not needed if you are going to monitor it locally, using the same user that Tomcat runs with.

But there is no further description for that simpler (local) method. If it is obvious, sorry, but I am lost here ;-)

posted Jun 27, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

It's actually very simple.

  1. Start up Tomcat from startup.sh / startup.bat
  2. Fire up visualvm
  3. The Local node should have Tomcat visible
  4. Double-click on the Tomcat element, and you're connected

Getting a first start on where your leaks are is pretty easy as well.

  1. Load your web application
  2. Run it to generate the leak
  3. Unload it from Tomcat using the manager app (or any other method)
  4. Do a Find Leaks from the manager app (or garbage collection from VisualVM)
  5. Do a heap dump
  6. In the classes, look for org.apache.catalina.loader.WebappClassLoader
  7. Find the instance where the boolean started is false
  8. Right-mouse on the instance and search for nearest GC Root
  9. Find classes that you wrote and fix

This gets the classLoader leak . . . others can be found by looking for application - specific classes.

answer Jun 27, 2013 by anonymous
Similar Questions
+1 vote

I am running Tomcat 7.0.41 on a Windows laptop (8.1 Pro). I recently reinstalled the Windows and since re-installing tomcat and my server application, it runs fine when I connect to it from a web browser.

However, when I tell my desktop client app to connect to the server, it fails on the initial connection with a 405status. I am running the server is debug, from Eclipse, and have put breakpoints in the doGet, doPost, and doPut methods of my ControllerServlet class that extends the java.servlet.http.HttpServlet. None of these breakpoints fire before the client gets back the 405 status. (the client works fine if connecting to the real server running tomcat 6 on an Ubuntu server.)

I can find no place locally where verb filtering is being configured.

Any suggestions?

+1 vote

I had installed tomcat 8 port 80 on Amazon AWS EC2, but netstat, fuser does show me tomcat on port 80. Browser gives 404 error and connection refused. I wrote to Amazon support for the misery...

0 votes

I am using Tomcat version 7.0.63.
I have registered the dbconnection pool with MBeanServer.
Is there a way to make those methods hot setting? What I mean by this is, for example if I change statement cache size in the jconsole, it should take effect immediately.

Any help is greatly appreciated.

+2 votes

With Tomcat 7.0.40 version, we are using Tomcat DBCP for pooling connections.

We are able to pool connections for different aliases. But for one alias, connections are not pooling. The user and password is good because the same alias in apache dbcp works fine.

Why are we not able to pool any connections here?

0 votes

Using tomcat 6.I Always confused with connectionTimeout

The number of milliseconds this *Connector* will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds).

Helpful if anyone can explain.?

Is there any connector parameter where i can set request timeout.?Rather than at application level timeout i want tomcat to timeout after certain period if request taking long time..

...