2 Replies Latest reply on Feb 11, 2009 3:14 PM by sjewett

    java.lang.OutOfMemoryError: PermGen space

    sjewett

      Any help is appreciated:

      I downloaded JBoss Portal 2.7.1 from Sourceforge
      running on JBoss App Server 4.2.3.GA
      Using the embedded HSQLDB
      Windows XP 5.1.2600, SP2
      Total Physical Memory: 1,025 MB

      I'm getting a java.lang.OutOfMemoryError: PermGen space error. I thought I could modify the run.conf file to increase the available memory, but it doesn't seem to work. Here is my run.conf file:

      ## -*- shell-script -*- ######################################################
      ## ##
      ## JBoss Bootstrap Script Configuration ##
      ## ##
      ##############################################################################
      
      ### $Id: run.conf 62747 2007-05-02 17:43:36Z dimitris@jboss.org $
      
      #
      # This file is optional; it may be removed if not needed.
      #
      
      #
      # Specify the maximum file descriptor limit, use "max" or "maximum" to use
      # the default, as queried by the system.
      #
      # Defaults to "maximum"
      #
      #MAX_FD="maximum"
      
      #
      # Specify the profiler configuration file to load.
      #
      # Default is to not load profiler configuration file.
      #
      #PROFILER=""
      
      #
      # Specify the location of the Java home directory. If set then $JAVA will
      # be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
      #
      #JAVA_HOME="/opt/java/jdk"
      
      #
      # Specify the exact Java VM executable to use.
      #
      JAVA="C:\Program Files\Java\jre1.5.0_5\bin\java.exe"
      
      #
      # Specify options to pass to the Java VM.
      #
      if [ "x$JAVA_OPTS" = "x" ]; then
       JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
      fi
      
      # Sample JPDA settings for remote socket debuging
      #JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
      
      # Sample JPDA settings for shared memory debugging
      #JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"
      
      JAVA_OPTS="-XX:MaxPermSize=512m"


      Did I edit the run.conf incorrectly? Again, any help is appreciated

      -sjewett


        • 1. Re: java.lang.OutOfMemoryError: PermGen space
          antoine_h

          Hello,

          this is about the memory available for class loading.

          It looks like the default value of this part of memory is not enough.

          I don't know what is the minimum requiered, but I personnaly have set much more.
          I set this in the options of the JVM :

          -Xms384m -Xmx1024m -XX:MaxPermSize=384m


          -XX:MaxPermSize is to tell the JVM to provide more "Perm" memory.

          start with 128 or 256... and if you have again some "PermGen space error", add some more.

          over the past two years, I had regularly to add some.
          it looks like that JSF is asking a lot of classes to be loaded (several for each type of component), ... and the needs for a server/JVM that runs some jsf is much more than other java applications.

          the portal, in the sample and in the administration, is now using jsf... that is why it asks more Perm.
          the portal engine, (pur java) is not asking a lot by itself.


          • 2. Re: java.lang.OutOfMemoryError: PermGen space
            sjewett

            Thanks, Antoine. That worked. I had to edit the run.bat file before it would work. I thought that I could simply edit run.conf . . . but that did not work.

            Thanks, again.

            -Steve