unix

How do I increase the heap size for my Tomcat server?

To increase the heap size for your tomcat server, you can start the JVM with a higher heap memory maximum using the -Xmx switch. The higher you make this, the more memory is available for Tomcat to use. This change makes it so the JVM won’t need to invoke the garbage collector as often, so the server can reserve more CPU time for serving web requests and requests can be completed faster.

If your webapp runs on a dedicated server, just give the JVM as much of the machine’s physical memory as you can safely give it. If it is running on shared or virtual hardware, you can set up JConsole or another console to see how much memory your webapp tends to use under high load circumstances so that you can set a more reasonable maximum heap size setting.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top