It’s quite common to run In memory problems when running some big Java EE application on a Tomcat server. This is about a full Heap space: SEVERE: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: Java heap space This other is about the PermGen space that’s a memory area, where compiled classes (and MemoryError: PermGen space java.lang.OutOfMemoryError: PermGen space To increase the memory available to Tomcat, about heap and permgen the correct options are the following ones. This sets the max heap available to Tomcat at 1Gb of memory: --JvmMx 1024 This sets the max permgen available to Tomcat at 256Mb of memory: -XX:MaxPermSize=256m To change the Tomcat memory settings (when Tomcat is installed on Windows as system service), it’s required to use the command-line tool tomcat6 //US//Tomcat6 --JvmMx 1024 ++JvmOptions="-XX:MaxPermSize=256m" The label It’s even possible to update memory settings from a GUI frontend, or to view what happened after running the command line tool. Running the following command: tomcat6w //ES//Tomcat6 a window will open showing all the parameters about the windows service Tomcat6. It’s possible to see in this image that, after running the previous command, for setting higher memory limits, in the sections Maximum memory pool and at the end of the Java Options the new memory limits are set. |
|