12 Replies Latest reply on Sep 24, 2010 2:44 PM by samjackson

    JBoss 4.2.3 GA on 64bit JVM

    prabhunatarajan

      Hi,

       

      Currently our JBoss server - 4.2.3 GA is running on JDK 1.5, with the following JAVA Options on Solaris SPARC.

       

      -Xms3g -Xmx3g -XX:ThreadStackSize=128 -XX:+UseParallelGC -XX:MaxPermSize=256m -XX:NewRatio=1

       

      This was working fine, however currently we need to handle huge volumes of data. The server is either hanging or getting stopped.

      I found that garbage collection is taking lots of time and getting errors like 'ParallelGCFailedAllocation'

       

      So decided to run the server on Java 6 as there is improvement in the garbage collection process. [In Java 6 -  There will be short pause by the garbage collector and that will allow other threads to perform well]

       

      I got Java 6 with 64 bit JVM installed in the Solaris box. I could confirm that by running java -d64 -version.

       

      Questions:

       

      1. How to make the JBoss server run on 64bit JVM?

       

      I tried adding -d64 to the above options and also tried adding -J-d64 to the launcher org.jboss.Main

       

      However the server did not start and there are no logs.

       

      2. How to increase the heap memory from 3g to 4g or 5g?

       

      When I increase the memory other than 3g the server did not start and there are no logs.

       

      The server starts only when I leave the above options as it.

       

      3. The Java projects are compiled in Java 5. I think that is not an issue, as there will be backward compatibility?

       

      4. Whether I need to alter some of the options above?

       

      It will be very helpful if some one throws some light on these?

       

      Regards,

      Prabhu

        • 1. Re: JBoss 4.2.3 GA on 64bit JVM
          peterj

          I think that you are expecting magic from Java SE 6, but I don't think you will get it - the GC pause times will be somewhat better but they will still probably hurt.

           

          1) No change is needed - Java byte code is platform independent so you can run it on a 32-bit or 64-bit JVM (some of my coworkers run JBoss AS on a 48-bit JVM running on a mainframe, and they are using the exact same JBoss AS files I am on my Windows box). But then you are running on Solaris and it has weird options for 64 bit that are not needed on Windows or Linux, perhaps someone with Solaris experience can comment on the exact command line arguments required for the Solaris JVM.

           

          2) How much RAM do you have? Is there a memory size limitation for apps in Solaris? On my 64-bit Windows dekstop with 8GB RAM and an 8GM swap drive I have easily run with setting such as -Xmx12G. Also, try starting, from a shell, a simple "hello world" Java app with the heap setting you are trying to use - the JVM should give you some kind of error message.

           

          3) That is not an issue. The Java byte code is backwards compatible - I have runn even 1.3.1 compiled bytecode with JVM 5.

           

          4) What options? (Though I suspect my prior answers answered your questions.)

           

          By the way, you should really gather and analyse your GC data to see what could be improved.  For suggestions on how to gather GC data and analyze it, see these white papers:

           

          Java Garbage Collection Statistical Analysis 101

          Java Garbage Collection Performance Analysis 201

           

          at http://www.cmg.org/cgi-bin/search.cgi?q=java+peter+johnson&x=30&y=10

          • 2. Re: JBoss 4.2.3 GA on 64bit JVM
            prabhunatarajan

            Thank you Peter for the clarifications,

             

            And sorry I was on vacation, tested this today,

             

            I could not run with 64 bit jvm, by providing option like -d64

             

            I passed  -d64 to the JAVA_OPTS, however the server did not start and there is no log.

            [ JAVA_OPTS="-d64 -Xms3g -Xmx3g -XX:ThreadStackSize=512 -XX:+UseParallelGC -XX:MaxPermSize=256m -XX:NewRatio=2" ]

             

            For Solaris I found this link,

            http://java.sun.com/docs/hotspot/HotSpotFAQ.html

             

            where under the heading -

            When you download the SDK or JRE, must you choose between the 32 and 64-bit versions?

             

            It is specified to pass -d64 to use 64 bit jvm.

            We have enough memory and it is a global zone, so when the admin installed Java 6 it is shared across around 6 systems. The total memory is around 98 GB.

             

            Any thoughts why JBoss 4.2.3 does not respond if I add -d64?  Without that I could not increase the Heap memory as well, if I increase to 4g without passing -d64, then also the server is not starting.

             

            Regards,

            Prabhu

            • 3. Re: JBoss 4.2.3 GA on 64bit JVM
              peterj

              >>why JBoss 4.2.3 does not respond if I add -d64?

              First, this has nothing to do with JBoss AS. The whole issue is how to get a 64-bit JVM to run a Java app on Solaris. I suggest that you first try running a simple hello world app from the command line. Once you get the command line options correct for that, you can apply the same options to JBoss AS. Also, how are you starting JBoss AS? If not from a command line using run.sh, I recommend that you try running from the command line first.

               

              >>When you download the SDK or JRE, must you choose between the 32  and 64-bit versions?

              Which one did you download? If you downloaded the 32-bit version, you cannot run in 64-bit mode. (It used to be that you had to first install the 32-bit version and then the 64-bit version on SPARC, I don't know if that is still the case.)

              • 4. Re: JBoss 4.2.3 GA on 64bit JVM
                prabhunatarajan

                Thanks Peter,

                 

                You are right, I should have tried from command line first,

                 

                I tried running a HelloWorld using the below JVM options, it is executing without any error.

                 

                java -d64 -Xms6g -Xmx6g -XX:ThreadStackSize=512 -XX:+UseParallelGC -XX:MaxPermSize=256m -XX:NewRatio=2 jvmtest.TestJava6Update21

                Hello World!

                 

                However when I run the run.sh from command line by passing the same options as above I get the below error,

                 

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

                Server Environment

                 

                  HOME: /tui/cyrus/jboss

                 

                  VERSION:

                 

                  JAVA_HOME: /usr/java/bin/java

                 

                  JAVA_OPTS: -Dprogram.name=run.sh -server -d64 -Xms3g -Xmx3g -XX:ThreadStackSize=512 -XX:+UseParallelGC -XX:MaxPermSize=256m -XX:NewRatio=2

                 

                  CLASSPATH: /tui/cyrus/jboss/bin/run.jar:/usr/java/lib/tools.jar

                 

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

                 

                Exception in thread "main" java.lang.NoSuchFieldError: strm
                        at java.util.zip.Inflater.initIDs(Native Method)
                        at java.util.zip.Inflater.<clinit>(Inflater.java:68)
                        at java.util.zip.ZipFile.getInflater(ZipFile.java:266)
                        at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)
                        at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)
                        at java.util.jar.JarFile.hasClassPathAttribute(JarFile.java:465)
                        at java.util.jar.JavaUtilJarAccessImpl.jarFileHasClassPathAttribute(JavaUtilJarAccessImpl.java:21)
                        at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.java:903)
                        at sun.misc.URLClassPath.getLoader(URLClassPath.java:302)
                        at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
                        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
                        at java.security.AccessController.doPrivileged(Native Method)
                        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

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

                 

                 

                I am using Java 6 Update 21, we installed 32 bit and then the 64 bit on Solaris.

                 

                When I type the below commands,

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

                 

                [cyrus@uktapp08 SIT]>java -d32 -version
                java version "1.6.0_21"
                Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
                Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)

                 

                [cyrus@uktapp08 SIT]>java -d64 -version
                java version "1.6.0_21"
                Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
                Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)

                 

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

                 

                I am not sure about this NoSuchField Error, any thoughts on this?

                 

                Regards,

                Prabhu

                • 5. Re: JBoss 4.2.3 GA on 64bit JVM
                  peterj

                  You might not be using the same JVM for the hello world app and JBoss AS - note that JBoss AS uses the JVM designated by JAVA_HOME. What happens if you enter:

                   

                  /usr/java/bin/java -d64 -version

                  • 6. Re: JBoss 4.2.3 GA on 64bit JVM
                    prabhunatarajan

                    Hi Peter,

                     

                    When I use   /usr/java/bin/java -d64  -version

                     

                    This is the output,

                     

                    [cyrus@uktapp06 DEV]>/usr/java/bin/java -d64 -version

                     

                    java version "1.6.0_21"

                    Java(TM) SE Runtime Environment (build 1.6.0_21-b06)

                    Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)

                     

                    I then printed  from a jsp,

                     

                    System.getProperty("sun.arch.data.model")

                    System.getProperty("java.version")

                     

                    Got outputs - 32 and 1.6.0_21

                     

                    Then from another post of yours - http://community.jboss.org/thread/2669?decorator=print&displayFullThread=true

                     

                    I added the option '-XX:+TraceClassLoading' to find the class loading details and got the below error.

                     

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

                    [Loaded java.util.zip.InflaterInputStream from /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jar]
                    [Loaded java.util.zip.ZipFile$1 from /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jar]
                    [Loaded java.util.zip.Inflater from /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jar]
                    [Loaded java.lang.NoSuchFieldError from /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jar]
                    Exception in thread "main" java.lang.NoSuchFieldError: strm
                            at java.util.zip.Inflater.initIDs(Native Method)
                            at java.util.zip.Inflater.<clinit>(Inflater.java:68)
                            at java.util.zip.ZipFile.getInflater(ZipFile.java:266)
                            at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)
                            at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)
                            at java.util.jar.JarFile.hasClassPathAttribute(JarFile.java:465)
                            at java.util.jar.JavaUtilJarAccessImpl.jarFileHasClassPathAttribute(JavaUtilJarAccessImpl.ja                                   va:21)
                            at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.java:903)
                            at sun.misc.URLClassPath.getLoader(URLClassPath.java:302)
                            at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
                            at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
                            at java.security.AccessController.doPrivileged(Native Method)
                            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                    [Loaded java.lang.Shutdown from /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jar]
                    [Loaded java.lang.Shutdown$Lock from /usr/jdk/instances/jdk1.6.0/jre/lib/rt.jar]

                     

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

                     

                    Please let me know whether any issue in rt.jar file?

                     

                    Regards,

                    Prabhu

                    • 7. Re: JBoss 4.2.3 GA on 64bit JVM
                      peterj

                      Ahah, see this part of the stack trace:

                       

                      at java.util.zip.Inflater.initIDs(Native Method)

                       

                      That means that this method is executing in a native C library. On Windows I think this is handled by java_home/jre/bin/zip.dll. Apperently the corresponding file on your system is corrupt.

                      • 8. Re: JBoss 4.2.3 GA on 64bit JVM
                        prabhunatarajan

                        Thanks for spotting this Peter,

                         

                        I could find the equivalent shared library files like 'libzip.so' under /usr/jdk/instances/jdk1.6.0/jre/lib/sparcv9

                         

                        However I am not sure why they are not picked up from rt.jar.

                         

                        I think there is an issue in the installation?

                         

                        Regards,

                        Prabhu

                        • 9. Re: JBoss 4.2.3 GA on 64bit JVM
                          peterj

                          Reinstalling the JDK is the first thing I would try. If that doesn't work, you might have to get your sysadmin (or Solaris support person) involved to help you track down exactly what is going wrong.

                          • 10. Re: JBoss 4.2.3 GA on 64bit JVM
                            sreeni.karnati

                            Hi peter,

                             

                              I am struggling to install jboss-6.0-M3 in my Laptop.My laptop is windows 7 , 64 bit. My requirement is to add the jboss server to netbeans 6.8.Can u please help me regarding this issue

                            • 11. Re: JBoss 4.2.3 GA on 64bit JVM
                              prabhunatarajan

                              Thanks Peter,

                               

                              This is resolved after reinstalling Java 6 Update 21.

                              • 12. Re: JBoss 4.2.3 GA on 64bit JVM
                                samjackson

                                I just installed latest java update and it solves my problem. thanks

                                Web Design Brisbane