8 Replies Latest reply on Oct 16, 2008 3:53 AM by ridzuan_majid

    Problem with java.lang.OutOfMemoryError

    ridzuan_majid

      Hi there,

      I really need someone to help me regarding on this problem. I'm using 1Gb Memory and diskspace 30Gb. When i start JBOSS, this error appear:

      03:43:29,560 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/usr/local/jboss-3.2.5/server/default/deploy/http-i
      nvoker.sar/invoker.war/
      03:43:30,610 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
      03:43:30,630 ERROR [WebappLoader] LifecycleException
      java.lang.VerifyError: (class: org/apache/catalina/loader/WebappClassLoader, method: modified signature: ()Z) Out Of Memory
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java, Compiled Code)
      at org.apache.catalina.loader.WebappLoader.createClassLoader(WebappLoader.java:807)
      at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java, Compiled Code)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java, Compiled Code)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java, Compiled Code)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
      at java.lang.reflect.Method.invoke(Native Method)

        • 1. Re: Problem with java.lang.OutOfMemoryError
          erasmomarciano

          Try , to set in run.conf the following variable

          JAVA_OPTS="-Xms512m -Xmx512m"

          • 2. Re: Problem with java.lang.OutOfMemoryError
            erasmomarciano


            Try , to set in run.conf the following variable

            JAVA_OPTS="-Xms384m -Xmx384m"

            • 3. Re: Problem with java.lang.OutOfMemoryError
              thetikigod

              Periodically when developing and redeploying web apps, an error will occur and the JBoss AS will crash, burn, and will require a restart. Most of the time, the error is an out of memory error and will appear in the console as follows:

              10:10:22,640 ERROR [MainDeployer] Could not create deployment: file:(yourFile)
              java.lang.OutOfMemoryError: PermGen space
              


              To fix this you will need to modify the run file, again. There are two options: increase the size of the PermGen or allow garbage collection on PermGen . Each method has its pro/cons. Increasing the size of the PermGen will only delay the errors longer, because the memory will be used up eventually. If all you are looking to do is increase the time between restarts, this is a viable solution. If low memory is an issue or if the error must be prevented altogether, then garbage collection should be permitted on PermGen. With this solution, you may run the risk of garbage collecting classes that will be used again (this has not been tested). Both may be used which may lessen the risk that classes will be collected before their time. Realize that this does not eliminate the risk. Note that both methods will require JBoss AS to be restarted.

              Increase Memory Size of PermGen:

              1. Navigate to JBOSS_HOME/bin/.
              2. Open the run.conf (run.bat for windows) file for editing.
              3. Add the following after the remote debugging lines:

              In run.conf:
               # Memory configuration to delay PermGen: OutOfMemoryError(s)
               JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=512m"
              

              In run.bat:
               rem Memory configuration to delay PermGen: OutOfMemoryError(s)
               set JAVA_OPTS=-XX:MaxPermSize=512m %JAVA_OPTS%
              

              4. Save the file.
              5. PermGen will be configured with a larger memory space.

              *Note: A size other than 512 may be used.




              Garbage Collection on PermGen

              1. Navigate to JBOSS_HOME/bin/.
              2. Open the run.conf (run.bat for windows) file for editing.
              3. Add the following after the remote debugging lines:

              In run.conf:
               # Garbage Collection configuration to fix PermGen: OutOfMemoryError(s)
               JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled"
              

              In run.bat:
               rem Garbage Collection configuration to fix PermGen: OutOfMemoryError(s)
               set JAVA_OPTS= -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled %JAVA_OPTS%
              

              4. Save the file.
              5. PermGen will be configured to be garbage collected.

              • 4. Re: Problem with java.lang.OutOfMemoryError
                ridzuan_majid

                I already try the both command to increase PermSize but I got this error :

                Unrecognized option: -XX:MaxPermSize=512m
                Could not create the Java virtual machine.

                • 5. Re: Problem with java.lang.OutOfMemoryError
                  peterj

                  What JVM are you using? My guess is it is not a Sun JVM.

                  • 6. Re: Problem with java.lang.OutOfMemoryError
                    ridzuan_majid

                    This is the version on Java that im using.

                    java version "1.3.1_06"
                    Java(TM) 2 Runtime Environment, Standard Edition (build SCO-UNIX-J2SE-1.3.1_06:*FCS*:20021212)
                    Classic VM (build SCO-UNIX-J2SE-1.3.1_06:*FCS*:20021212, native threads, sunwjit)

                    • 7. Re: Problem with java.lang.OutOfMemoryError
                      peterj

                      Wow, that is ancient, and not from Sun. Though I suspect that SCO is (was?) a Sun licensee and simple recompiled the Sun JVM for use on their flavor of UNIX.

                      I tried my JDK 1.3.1_12, and it accepts the MaxPermGen option. Looks like SCO made some changes. You will have to ask SCO what to do about this.

                      • 8. Re: Problem with java.lang.OutOfMemoryError
                        ridzuan_majid

                        Seems like that.. SCO make some changes.. Actually this system still running on SCO-UNIX, i need to upgrade but need to take a look at the original system when running on SCO