A logo showing the text blog.marcnuri.com
Español
Home»Java»java.lang.OutOfMemoryError: PermGen space // More memory for Tomcat under windows

Recent Posts

  • Fabric8 Kubernetes Client 6.4.0 is now available!
  • I bought an iPad
  • Three years at Red Hat
  • Fabric8 Kubernetes Client 6.3.1 is now available!
  • Eclipse JKube 1.10 is now available!

Categories

  • Front-end
  • Java
  • JavaScript
  • Legacy
  • Operations
  • Personal
  • Pet projects
  • Tools

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • December 2019
  • October 2019
  • September 2019
  • July 2019
  • March 2019
  • November 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • December 2017
  • July 2017
  • December 2015
  • November 2015
  • November 2008
  • November 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007

java.lang.OutOfMemoryError: PermGen space // More memory for Tomcat under windows

2007-08-22 in Java / Legacy tagged Apache / Apache Tomcat / J2EE / Memory / Performance / Tomcat / Windows by Marc Nuri | Last updated: 2021-02-18

In many cases, web applications give OutOfMemoryError when their processes require high amounts of memory. Image manipulation, intensive database use, file processing and other common tasks lead to this very common problem.

Normally when you get an OutOfMemory error (not caused by a memory leak) in a desktop application, you can solve this problem by specifying the Java arguments -Xms*** (initial Java heap size) and -Xmx*** (maximum Java heap size) when running your program.

To solve this issue in Tomcat, you must specify these options in the Tomcat startup command / script. In windows, Tomcat is usually installed as a service. Tomcat provides a configuration tool to set up these and other parameters. You can find it in (Start->Programs->Apache Tomcat->Configure Tomcat) or by running (.\bin\tomcat5w.exe //EN//Tomcat5).

A screenshot of the Apache Tomcat Properties dialog in Windows
A screenshot of the Apache Tomcat Properties dialog in Windows

Under the "Java" tab you can find two options:

  • Initial memory pool: This corresponds to -Xms, you can specify the size in Mb.
  • Maximum memory pool: This corresponds to -Xmx, you can specify the size in Mb.

Now you can specify a higher maximum memory so that Tomcat doesn't get the OutOfMemoryError. Remember to take into account your hardware capabilities.

Twitter iconFacebook iconLinkedIn iconPinterest iconEmail icon

Post navigation

← Viewing and storing images from an IP CameraUpdated: Displaying a jTable inside another jTable // JTable cellRenderer →
© 2007 - 2023 Marc Nuri