7 Replies Latest reply on Dec 2, 2008 11:18 AM by Peter Johnson

    OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JBoss

    Nuada C Newbie

      Salve,

      Firstly, I'm new to JBoss so excuse the lack of knowledge!

      I'm trying to deploy my jsf app to JBoss and hit an OutOfMemoryError.
      I changed the default settings in run.bat to
      set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m -XX:MaxPermSize=256m

      I have GBs of free space on my C: and D: disks, but I still hit the out of memory error.

      Any ideas?

        • 1. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
          Peter Johnson Master

          There are many possible reasons for getting an out of memory error. Unfortunately, without seeing the full error message, I cannot begin to guess what memory you are out of. Please post full stack trace for the exception.

          Also, what operating system, what version of JBoss AS, what version of JDK, and how much RAM do you have (having free disk space is meaningless).

          • 2. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
            Nuada C Newbie

            Hi Peter,

            I'm using JBoss 5.0 RC 2 (JDK 6) on Windows XP.
            I'm deploying a JSF 1.2 compatible app written in Oracle JDeveloper using Oracle's ADF framework (JSF 1.2 compatible). I srarted by copying the required ADF libs to the JBoss \default\lib directory. I then dropped the exploded ear/war file into the \default \deploy directory. The auto-deploy starts ansd eventually I get the following -

            2008-12-01 15:18:13,753 WARN [org.jboss.detailed.classloader.ClassLoaderManager] (main) Unexpected error during load of:oracle.security.jps.principals.JpsRole
            java.lang.OutOfMemoryError

            java.lang.NoClassDefFoundError: oracle/security/jps/principals/JpsRole

            This class is contained in jps-api.jar, which I have already copied over to \default\lib.

            • 3. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
              Peter Johnson Master

              Sounds like you are out of permgen. Try increasing MaxPermSize (though, frankly I am amazed that 256MB is not enough).

              • 4. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
                Nuada C Newbie

                Hi Peter,

                Here is what happens when I increase the PermGen to 512M


                JBoss Bootstrap Environment

                JBOSS_HOME: D:\aaaJBoss5\jboss-5.0.0.CR2

                JAVA: D:\beaJdev\jdk160_05\bin\java

                JAVA_OPTS: -Dprogram.name=run.bat -server -Xms512m -Xmx1024m -XX:MaxPermSize
                512m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000
                sun.rmi.dgc.server.gcInterval=3600000

                CLASSPATH: D:\aaaJBoss5\jboss-5.0.0.CR2\bin\run.jar

                ==============================================================================

                Error occurred during initialization of VM
                Could not reserve enough space for object heap
                Could not create the Java virtual machine.
                Press any key to continue . . .

                • 5. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
                  Peter Johnson Master

                  Put it back to 256m, and add -XX:+PrintHeapAtGC and post the last two or three heap printouts.

                  • 6. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
                    Nuada C Newbie

                    Hi Peter,

                    {Heap before GC invocations=57 (full 2):
                    PSYoungGen total 92608K, used 3420K [0x4c810000, 0x539d0000, 0x539d0000)
                    eden space 68736K, 0% used [0x4c810000,0x4c810000,0x50b30000)
                    from space 23872K, 14% used [0x50b30000,0x50e870d8,0x52280000)
                    to space 23680K, 0% used [0x522b0000,0x522b0000,0x539d0000)
                    PSOldGen total 233024K, used 223779K [0x139d0000, 0x21d60000, 0x4c810000)
                    object space 233024K, 96% used [0x139d0000,0x21458c70,0x21d60000)
                    PSPermGen total 48128K, used 48096K [0x039d0000, 0x068d0000, 0x139d0000)
                    object space 48128K, 99% used [0x039d0000,0x068c83e8,0x068d0000)
                    Heap after GC invocations=57 (full 2):
                    PSYoungGen total 92608K, used 0K [0x4c810000, 0x539d0000, 0x539d0000)
                    eden space 68736K, 0% used [0x4c810000,0x4c810000,0x50b30000)
                    from space 23872K, 0% used [0x50b30000,0x50b30000,0x52280000)
                    to space 23680K, 0% used [0x522b0000,0x522b0000,0x539d0000)
                    PSOldGen total 233024K, used 143258K [0x139d0000, 0x21d60000, 0x4c810000)
                    object space 233024K, 61% used [0x139d0000,0x1c5b6a80,0x21d60000)
                    PSPermGen total 83200K, used 48096K [0x039d0000, 0x08b10000, 0x139d0000)
                    object space 83200K, 57% used [0x039d0000,0x068c83e8,0x08b10000)
                    }
                    {Heap before GC invocations=58 (full 2):
                    PSYoungGen total 92608K, used 68736K [0x4c810000, 0x539d0000, 0x539d0000)
                    eden space 68736K, 100% used [0x4c810000,0x50b30000,0x50b30000)
                    from space 23872K, 0% used [0x50b30000,0x50b30000,0x52280000)
                    to space 23680K, 0% used [0x522b0000,0x522b0000,0x539d0000)
                    PSOldGen total 233024K, used 143258K [0x139d0000, 0x21d60000, 0x4c810000)
                    object space 233024K, 61% used [0x139d0000,0x1c5b6a80,0x21d60000)
                    PSPermGen total 83200K, used 48361K [0x039d0000, 0x08b10000, 0x139d0000)
                    object space 83200K, 58% used [0x039d0000,0x0690a558,0x08b10000)
                    Heap after GC invocations=58 (full 2):
                    PSYoungGen total 89728K, used 8838K [0x4c810000, 0x53700000, 0x539d0000)
                    eden space 68928K, 0% used [0x4c810000,0x4c810000,0x50b60000)
                    from space 20800K, 42% used [0x522b0000,0x52b518c0,0x53700000)
                    to space 22336K, 0% used [0x50b60000,0x50b60000,0x52130000)
                    PSOldGen total 233024K, used 143258K [0x139d0000, 0x21d60000, 0x4c810000)
                    object space 233024K, 61% used [0x139d0000,0x1c5b6a80,0x21d60000)
                    PSPermGen total 83200K, used 48361K [0x039d0000, 0x08b10000, 0x139d0000)
                    object space 83200K, 58% used [0x039d0000,0x0690a558,0x08b10000)
                    }
                    09:13:43,000 WARN [ClassLoaderManager] Unexpected error during load of:oracle.security.jps.principals.JpsRole
                    java.lang.OutOfMemoryError


                    thanks

                    • 7. Re: OutOfMemoryError deploying an JSF 1.2 app (ADF11g) to JB
                      Peter Johnson Master

                      According to the heap statistics, you have plenty of heap available. You are using only 58% of an 80MB permgen (and the max is 256MB, so it can grow if needed). Also, the tenured generation is only 61% used.

                      Is there no other text or a stack trace? (I guess I would be happier if you posted about a dozen of so lines of the console log rather than the one warning line - right now I get the feeling that the answer lies in the lines you did not post.)

                      Are you running in a virtual machine?

                      How much RAM do you have? Look at Task Manager and see what it has to say about memory usage.