Web Development

Getting VisualVM to Connect to Railo 4


VisualVM is a great Java VM debugging tool that can show you VM performance as it runs your code. Since Railo runs on Java VM, this is a great tool to see if your code is leaking memory.

NOTE: This setup is on a debian linux box running railo installed via the script with an apt-get install apache frontend. This should behave similarly on ubuntu, centos, etc. Please leave comments if you have issues.

Edit /opt/railo/tomcat/bin/setenv.sh (~ line 6)

Append to the line with your JAVA_OPTS variable the commands in red below. ( I spaced out the code below for readability, but keep the red text to one line)

JAVA_OPTS=”-Xms512m -Xmx3G -XX:MaxPermSize=256m

-Dcom.sun.management.jmxremote.port=8701
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=<your server’s ip — i.e. 138.234.132.32>

“; # memory settings

Save and then restart “/etc/init.d/railo_ctl restart

SOME NOTES
-You can use any available port number
-Use your server’s real IP to tell where to bind the listener, without it, the listener will be localhost only.

openanalytics 2474 views

I'm a 35 year old UIUC Computer Engineer building mobile apps, websites and hardware integrations with an interest in 3D printing, biotechnology and Arduinos.


View Comments
There are currently no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.