Monday, 3 January 2011

How to solve permgen space error while starting the tomcat

HI ALL,
A week ago i have configured hudson continuous integration tool for one of my project, In that i should need to start tomcat server through bootstrap.jar using .xml file but i couldn't start it, reason is memory out of bound exception ie. permgen space error.

Here i would like to share my approach to solve this problem.

Steps to resolve the permgen space error while starting the tomcat through bootstrap.jar

Step 1. Create a build.xml file to start the tomcat server. sample code is mentioned below.

Sample .xml file

<?xml version="1.0"?>

<project name="markettravel" basedir="." default="all">
<target name="tomcat-start">
<java jar="path to /bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=path to tomcat-6.0.26"/>
<jvmarg value="-XX:MaxPermSize=512m"/>






In above code i have added one argument to allocate the perm memory size(jvmarg value="-XX:MaxPermSize=512m").

Step 2:

Now include this .xml file path to hudson tool and start building the project now you never see memory out of bound exception in console.

Happy using hudson.

No comments:

Post a Comment