5 Replies Latest reply on Mar 27, 2009 11:41 AM by peterj

    Sudden increase in Jboss memory

      Hi,

      I am using JBoss 4.0.5.GA. I have 8 EJBs deployed in that server. Java Swing application is talking to this server. Toplink is used to talk to the database[oracle].

      Xms and mx are set as 512 and 1024.
      Jboss normally uses around 250Mb and the application just runs fine. The JBoss server is restarted every morning.

      Every now and then, within a matter of seconds, JBoss would go from 250Mb to 1024Mb and stop responding to user calls.

      I checked the logs to check on all the requests that came in before JBoss stopped responding. Ther are no issues there.

      I just couldnot tell why Jboss would max out the menory all of a sudden.

      For some reason, it does ont throw OOM error either. It just stays there and occupies all the CPU and memory and stops responding.

      It is not a memory leak as it does not increase gradually. It just happens suddenly. More over, it does not happen every day. Users do the same thing everyday. So, I know for sure it is not related to what the user is doing.

      I could not reproduce in test environment.

      Hence, I could not really add profiler and reduce the performance in Production.

      Any thoughts?

      --augustinm

        • 1. Re: Sudden increase in Jboss memory
          peterj

          When this happens again you need to take a thread dump, I recommend 3 or 4 spaced a few seconds apart. Examining the running threads should tell you where in the code the issue is.

          When you say that memory usage goes from 250MB to 1024MB, what tool are you using to determine this?

          • 2. Re: Sudden increase in Jboss memory

            Thanks for the response PeterJ.

            I am monitoring the TaskManager. Java.exe would spike from 250mb to 1GB in a matter of few seconds. Once that happens, I could not really use JMX-Console anymore to lookat or dump the threads.

            Is there any other easy way to take a thread dump.?

            • 3. Re: Sudden increase in Jboss memory
              peterj

              Type CTRL-C in the command prompt window from which you started JBoss AS. If you are running it as a service, temporarily run from a command prompt so that you can get the thread dump.

              You can also use JConsole or VisualVM (they come with the JDK) to get a thread dump.

              • 4. Re: Sudden increase in Jboss memory

                Peter, Once i get a thread dump, whats next? What should I look for in the thread dump? Appreciate your help.

                • 5. Re: Sudden increase in Jboss memory
                  peterj

                  There will be a stack trace for each thread. This will give you and idea of what each thread is doing. Ignore threads waiting on the http queue, instead look for threads running you app code. Then in the next thread dump, look at the same threads to see what they are doing. Threads that appear to be in the same code for all the dumps. and the code they are in, is where the problem is at.