4 Replies Latest reply on Jul 22, 2003 9:37 AM by Jon Barnett

    JBoss 3.2.0, Crashes Unexpectedly

    dlastoria Newbie

      Hello everyone. First post here (of probably many to come). I'm a total JBoss newbie that was given responsibility over a Struts based order-entry system running on JBoss 3.2.0 on Redhat 7.3.

      I am having several problems with the application, but the one I'd like to resolve first is thus...

      Every couple of days JBoss crashes unexpectedly. There is no pattern to when it happens or a specific process that I can detect. We are using log4j and there are no errors reported in the log. The JBoss server doesn't go through the shutdown process or anything, it simply vanishes. When I do a "ps -C java" I see no JBoss processes running.

      Thanks for any assistance. I can provide more details of our configuration if needed.

        • 1. Re: JBoss 3.2.0, Crashes Unexpectedly
          Jon Barnett Master

          Which JDK? How much memory on the machine? What is the memory characteristics of JBoss (VSZ/RSS) - preferably after some time and after the applications on it have been used. How much free memory on the machine? How much swap and what is in swap? (From free)

          In the meantime, you can try shielding the JVM from OS signals by adding -Xrs to JAVA_OPTS in bin/run.sh of your JBoss distribution. It is possible that this is the primary reason for the shutdown. It is more usual to receive a signal that causes JBoss to shutdown properly rather than a -9 signal.

          • 2. Re: JBoss 3.2.0, Crashes Unexpectedly
            dlastoria Newbie

            Good information, thanks for the fast reply.

            In response to your questions:

            The server has 1GB of memory.

            After the application has been used for awhile the JVM has acquired roughly 200MB of memory.
            470MB cached...
            120MB buffer...
            150MB free...

            total used free shared buffers cached
            Mem: 1031004 872424 158580 0 122072 473004
            -/+ buffers/cache: 277348 753656
            Swap: 1044216 15720 1028496

            I'm not sure what you mean by memory characteristics of JBoss (VSZ/RSS), but I'll look into that and see if I can provide you that as well.

            Once again, thanks for your help.

            • 3. Re: JBoss 3.2.0, Crashes Unexpectedly
              dlastoria Newbie

              And I'm assuming the change you refer to is this:

              # Setup JBoss sepecific properties
              JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"

              add the -Xrs to this line of the startup script?

              # Setup JBoss sepecific properties
              JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME" -Xrs

              • 4. Re: JBoss 3.2.0, Crashes Unexpectedly
                Jon Barnett Master

                The change you show is fine, although you can put it inside the quotes. It shouldn't matter too much though.

                By VSZ/RSS, I just meant getting a 'ps aux' of the JBoss processes - it should tell you the virtual size and the resident in-memory portion of the JVM. However, it looks like you have plenty of memory so things are not going to terminate unexpectedly - at least in theory. Depending on the actual heap memory usage of the applications running in JBoss, you usually get memory allocation errors rather than the program just terminating.

                If you do have sizeable applications or many users, it may be possible that data structures cannot be created because there is not enough memory for the data and cause the JVM (Java Virtual Machine) to crash. It isn't normal though as you should get warnings.

                However, you can also try increasing at least the maximum heap size for the JVM. Without it, I think the maximum heap space is 16M.

                Again adding to your JAVA_OPTS line:
                -Xms16m -Xmx64m

                Minimum 16 M, maximum 64 M - you would need to tailor it for your real memory usage. But you have plenty of memory on your system. Maybe give it 256M maximum? A bit hard to guess.

                You can 'java -X' to look at the definitions of the various -X parameters.

                Again, hope it helps.