Welcome to this hands-on lab, where we will set Tomcat to use a fixed heap size. This is so that the memory is pre allocated.
We are using Apache’s Tomcat, a Java-based application platform built around deploying and managing Java Web Applications. The server provided in this lab environment is running Red Hat Enterprise 8 and has Tomcat 9 pre-installed for you. The Tomcat instance is available for you on port **8080**, on the provided server.
Once the heap size is set, you should be able to see the changes on the Tomcat Manager GUI page.
Successfully complete this lab by achieving the following learning objectives:
- Test to Ensure You Can Access the Preconfigured Tomcat Instances on Port 8080
Use the Tomcat server’s public IP address and port 8080 to connect to the Tomcat GUI and log in.
The username and password to use are the same as what’s provided for CLI access.
To access the server, copy the external IP address and paste it in your browser, then append :8080 to it.
For example, if the IP address shown was 18.104.22.168, then you would put the following into your web browser:
You should see the GUI.
Note: It may take from 3 to 10 mins after the hands-on lab has started before you can access the Tomcat server’s GUI on port 8080.
- Go to the Tomcat GUI and Check the JVM Memory Settings
Go to the Tomcat GUI and check the server status page. You should take note of the memory settings that are originally applied to the Tomcat instance.
- Change Your Tomcat Server so It Has a Minimum and Maximum Heap Size of 1gb
The options to add to the Tomcat startup file (you may need to create the file) are these:
This should be set in a file under the
These entries should be exported as
- Restart the Tomcat Server and Check the JVM Memory
Go to the Tomcat Manager GUI, then to the Server Status application and check the JVM memory.
It should reflect the changes you made to the minimum and maximum settings, and be much higher than the original settings.