6 Replies Latest reply on Mar 21, 2011 3:06 PM by Peter Johnson

    JBOSS out of swap space error

    bhavin2002patel Newbie

      Q1

      We have deployed jboss-4.2.2.GA version for one of our web application. Following is the memory setting in run.bat.

      set JAVA_OPTS=%JAVA_OPTS% -Xms128m-Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m

       

      When starting JBOSS server i am getting error of out of swap space. following are the parameters of server config.

       

      a. windows 2008 server 64 bit.

      b. 2 GB of ram.

       

      Will this problem be resolved by increasing the RAM?

       

      This was working fine till now. But i recently deployed some war files needed by application and i have started getting this error.

        • 1. JBOSS out of swap space error
          Wolf-Dieter Fink Master

          If I look to your JAVA_OPTS settings, I found that '-Xms128m-Xmx1024m' is without a space, could you correct this!

           

          If you deploy more war files the server might use more memory, MaxPermSize is additional to the 1024m Heap size and this might produce the error.

          You should post a bit more information about your memory (without and with the deployed additional war files).

          You can use <JAVA>/bin/jstat -gc to view the actual memory sizes.

           

          If the JVM could not get more memory from the system increasing of RAM might help, maybe you can check it before if you stop other application and services.

          • 2. JBOSS out of swap space error
            bhavin2002patel Newbie

            I checked by run.bat file there is a space. But since i copied from word documentation it appears differently.

            following is the setting i have in run.bat.

             

             

            set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m

            • 3. JBOSS out of swap space error
              Wolf-Dieter Fink Master

              Could you run 'jstat -gc <PID> 1000' in parallel if you start JBoss to see the memory utilization?

              See http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstat.html for more information.

               

              • 4. Re: JBOSS out of swap space error
                bhavin2002patel Newbie

                I tried this command on command prompt. But it says file not found.

                However if i just type jstat it does show me available options, which are very few compared to the link that you send me.

                 

                Is there any utility to be downloaded?

                 

                Also is <PID> needed to be replaced with process ID? there is no process running as i am run.bat file.

                • 5. JBOSS out of swap space error
                  Wolf-Dieter Fink Master

                  jstat is a tool shipped with java look into the bin directory of your installation of JDK.

                   

                  The PID is the processId of the JVM, look into the taskmanager for the java process of JBoss and use this..

                  You might see the memory used by the JVM as OC/EC/PC

                  • 6. Re: JBOSS out of swap space error
                    Peter Johnson Master
                    Will this problem be resolved by increasing the RAM?

                    Yes. 2GB is too little RAM for a 64-bit Server system. You could also increase the pagefile size, as long as you don't mind slow performance. ;-)

                     

                    But i recently deployed some war files needed by application and i have started getting this error.

                     

                    I doubt that this caused the problem. Most likely a recent Windows update increased the memory requirements for Window itself, or you are now runnign some extra app or service on that box. The error "out of swap space" essentailly means that there is not enough free memory (between RAM and the pagefile) to run the app (which is the JVM running JBoss AS in this case). Provided that you did not change the JVM statrup parameters (max heap size, max permgen size) then the JVM will not be taking up any more memory on startup than what it was before those additional WARs were deployed. (There could be an issue later, though, it deploying those WARs would cause more HTTP threads to be created, but that would result in an different error message.)