In this tutorial you will use a GUI utility that ships with Tomcat to configure Java options. This tutorial uses Tomcat6, but the techniques should be the same for newer releases.
Tomcat running as a Windows Service
Locate and copy the location of tomcat6w.exe (if using Tomcat7, this will be named tomcat7w)
- Open and navigate through directory windows as shown in the screen shot below.
- Right-click the directory path bar and click Copy address as text.
- The clipboard should contain a string such as C:\Program Files\jasperreports-server-4.5.1\apache-tomcat\bin.
Open a command line window with Administrator privileges
- From the Start menu, enter "command" in the Search programs and files box.
- From the list of files, right-click "Command Prompt" and choose Run as administrator.
Run the tomcat6w application
- In the command box, type "cd" (to change directories) then right-click to paste the path to the Tomcat bin directory. Press return.
- Now in the Tomcat bin directory, type "tomcat6w //ES//jasperreportsTomcat" and press return.
Click the Java tab. Edit the values in the Java Options box. The following settings allocate 2 GB memory to the start Java heap, 6 GB for the maximum heap size, 128 MB for the permgen space and 256 MB for the maximum permgen size.
The following settings allocate 2 GB memory to the start Java heap, 6 GB for the maximum heap size, 128 MB for the permgen space and 256 MB for the maximum permgen size.
-Xmx2048M -Xmx6144M other settings, e.g. thread stack, directory license location etc -XX:PermSize=128m -XX:MaxPermSize=256m
- Click OK to close the applet.
- Restart the Tomcat service (from the Start menu, you can navigate to JasperReports Server > Start or Stop Services).
- The Tomcat Windows service installed by the Jaspersoft installer is named jasperreportsTomcat.
- The //ES// command means "edit service". You can learn more about this at http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html.