Inicio > desarrollo > HowTo: nested exception is java.lang.outofmemory error permgen space tomcat

HowTo: nested exception is java.lang.outofmemory error permgen space tomcat

Fuente: https://wiki.openmrs.org/display/docs/Troubleshooting+Memory+Errors

If this error happens too frequently, you need to increase the amount of memory available to Tomcat.

Java Heap Size Exception

A Java Heap Size error occurs because of certain memory intensive actions (like Data Exporting). The new Spring managed API uses a lot of memory to cache the xml beans. You may need to increase the default memory allocation.

Solutions

Three options for increasing Tomcat’s allowed memory:

  • Start Tomcat with these parameters at the command line. Note: The current ANT task “Start Tomcat” will start with these options.

    -Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m

  • If running Tomcat as a Windows Service, open up the Tomcat Monitor (TOMCAT_HOME/bin/tomcat5w.exe). Configure Tomcat -> Java -> Java Options, or go to Control Panel > Services > Apache Tomcat > Properties > Start Parameters. Append:

    -Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m

    Note 1: if you copy and paste the above into tomcat monitor, make sure that it doesn’t insert an extra space at the end of each line, or tomcat will fail to start.
    Note 2: If running 64 bit version of Tomcat, you have to edit the Windows Registry HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\Tomcat5\Parameters\JavaJVM settings in Registry
    Note 3: It no longer works to set these parameters through a JAVA_OPTS environment variable

  • If running Tomcat as a Linux daemon, open the /etc/init.d/Tomcat.sh script and append the parameters to the CATALINA_OPTS variable: i.e.

    If CATALINA_OPTS is already set to this: CATALINA_OPTS=”-Djava.library.path=/opt/tomcat/lib/.libs”
    then change it to this: CATALINA_OPTS=”-Djava.library.path=/opt/tomcat/lib/.libs -Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m”

    For Ubuntu, see Jonah Mwogi’s directions in the comments below .

Solution for Tomcat memory leak:

  • In <TOMCAT HOME>/conf/web.xml file, in the jsp servlet definition add the following element: <init-param> <param-name>enablePooling</param-name> <param-value>false</param-value></init-param>
Categorías:desarrollo Etiquetas: ,
  1. Aún no hay comentarios.
  1. No trackbacks yet.

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: