Tomcat

Tomcat JVM Debugging

A quick summary of tips & tricks when debugging a webapp running in Tomcat. These come in handy if you're running into memory issues and want to track down memory leaks. Run JSTAT with gc option every 300s: cd saas_prod/java/bin jps jstat -gc Bootstrappid 300s >> nodejstat.log jps and jstat executables are in java bin dir jps command displays pid named "Bootstrap" jstat command will sample java memory every 300s Run TOP in batch mode with 300s delay period: ps -ef | grep java top -b -d 300 -p javapid >> nodetop.log Find the pid for tomcat java process The -b option runs top in batch mode The -d option sets the sample delay time to every 300s The -p option uses the specified pid Opening Tomcat Debug Port at 9191: Edit catalina.sh file under tomcat/bin Edit JAVAOPT variable to add these…