6 Replies Latest reply on Oct 16, 2002 8:23 AM by juha

    OutOfMemory Exception Jboss 3.0

    tripperm

      My company has recently moved our application from Jboss-2.4.6_Tomcat-4.0.3 to Jboss-3.0.2_Tomcat-4.0.5 using jdk1.3.1_01 jvm on a Windows 2000 box. Since the move we have been experiencing OutOfMemory exceptions. The actual exception thrown in the server.log file is as follows:

      2002-10-14 14:44:58,787 ERROR [STDERR] java.lang.reflect.InvocationTargetException: java.lang.OutOfMemoryError
      <<no stack trace available>>

      After reading several posts about possible memory leak problems, we have tried the following solutions with no luck:

      1) increased the heap size up top 128MB ( how much does Jboss 3.0.2 need? )
      2) changed the max-capacity element in the standardjboss.xml file from 1 million to 1000.

      I have also used Jprobe and some other profilers (hprof) to try and identify where the memory leak might be coming from, but have had no luck. Because our code works fine under Jboss 2.4.6 (no memory problems at all) but does not under Jboss 3.0.2, I’m not sure what to think. Is this a known issue, and does anyone have any other suggestions?

        • 1. Re: OutOfMemory Exception Jboss 3.0

          128MB heap is small, try something like 512MB

          • 2. Re: OutOfMemory Exception Jboss 3.0
            tripperm

            I admit that 128 is pretty small, but I had also tried 256MB and it also had the same problem. My concern is that if there really is a memory leak issue, the used memory will just continue to grow and grow hitting whatever limit I set it at.

            • 3. Re: OutOfMemory Exception Jboss 3.0

              obviously there aren't leaks that would cause hundreds of megabytes of memory to disappear, or people would have noticed it already

              how many concurrent clients do you have and how long has the server been running til you hit the out of memory exception?

              • 4. Re: OutOfMemory Exception Jboss 3.0
                tripperm

                We think we have identified the memory leak and it was a problem in our code. There were instances where PreparedStatement and ResultSet objects were being reused in a method without first closing them. This must have then left open objects that were not being garbage collected.

                The interesting thing though is that JBoss 2.4.6 let us get away with this, while JBoss 3.0.2 just kept on eating up memory until we crashed. I'm not sure what changed between the two versions to account for this. Anyway, just wanted to post our stupid mistake in the hope that it is some help to someone else one day ( I hate those posts where you never find out how the problem was ever solved.. ).

                And thanks for your responses juha. :)

                • 5. Re: OutOfMemory Exception Jboss 3.0

                  JBoss 2.4 didn't support open connections across
                  different transactions. It automatically closed
                  them when the transaction was committed/rolled back.

                  You wouldn't have noticed your bug :-)

                  Regards,
                  Adrian

                  • 6. Re: OutOfMemory Exception Jboss 3.0

                    agreed on the posts that leave solutions out, they suck

                    glad you found the cause