Java.lang.OutOfMemoryError: PermGen space using tomcat7 windows service

I am running tomcat 7.0.33 on a Windows 2008 R2 server (I installed tomcat as a Windows service)

  • JDK Version: jdk1.6.0_25 64-bit
  • Tomcat Options:

    • Java virtual machine: C:\Program Files\Java\jre6\bin\server\jvm.dll (BTW, I do not have a client folder inside jre)
    • Initial memory pool: 1000 MB
    • Maximum memory pool: 2000 MB

      when I check the status of the server, I see that the server is using the configured memory.

    • Environment Variables (SYSTEM VARIABLES) Configuration:

      • JAVA_HOME: C:\Program Files\Java\jdk1.6.0_25
      • Path: ...;%JAVA_HOME%\bin;....

Do I need to add the CATALINA_HOME and JAVA_OPTS system variables?

QUESTION: I have two web applications APP1 , * APP2 * when I deploy each separately, I can find that memory usage for

APP1 = 198 MB APP2 = 104 MB

Application Information:

APP1, APP2 : Spring Maven applications that include libraries of other small maven Spring applications.

APP1: Contains the web services used by APP2.

if I tried to deploy them both on the same tomcat instance, I always get

 java.lang.OutOfMemoryError: PermGen space 

Please report what might cause this problem.

+4
source share
4 answers

the solution was to set the initial and maximum memory pools, is to add -XX:MaxPermSize=1000m to the java options on the java tab.

+10
source

You probably need to set / increase the MaxPermSize parameter for your Tomcat instance. Please note that MAVEN_OPTS have nothing to do with Tomcat, these are options for the Maven command line process (mvn). The fact that your application is a "maven" application does not mean anything at run time, since Maven is not involved in launching your application, it is only a building .

In the \bin in your tomcat installation there should be an application called "tomcat7.exe". You can use this to update your tomcat service settings.

Try something like

tomcat7.exe // US // [your tomcat service name] --JvmOptions = -Xmx2g -Xms1g -XX: MaxPermSize = 512 m

Edit: the instruction above should be on one line, not two ...

+9
source

I had a similar problem, since our application runs on Tomcat without problems, when Tomcat works offline, and we continue to receive memory exceptions when starting Tomcat as a service.

I found a simillar solution to one of Pap. You need to access the Tomcat service GUI by running bin / tomcat7w.exe // ES // name_of_service. Go to the Java tab and set the appropriate java properties directly - for example. -XX:MaxPermSize=1000m

Here is a blog post that helped me explain that all Tomcat settings are ignored by Tomcat when running as a service. http://www.12robots.com/index.cfm/2010/10/8/Giving-more-memory-to-the-Tomcat-Service-in-Windows

+5
source

You need to increase PermGen space. Add something like -XX:MaxPermSize=128m to your options (you can reserve more gen gen space if you want). The -Xmx and -Xms for the heap, while you are running out of PermGen space , which is administered separately.

+3
source

Source: https://habr.com/ru/post/958951/


All Articles