10 Replies Latest reply on Sep 12, 2012 10:45 AM by Steven ONeill

    32bit OpenJDK on 64bit OS?

    Steven ONeill Newbie

      Hi,

       

      I am interested in running JBoss AS with the 32bit OpenJDK on a 64bit OS.  I am struggling to find simple instructions on this on the web.  I popped into the OpenJDK IRC technical help channel, and the only response to this I got was that someone tried it on Fedora 15-17, with much frrustation.

       

      This leads me to believe that 32bit OpenJDK on 64bit OS is a bad idea and uncommon at best.

       

      Can anyone comment if they have done this?  Perhaps I am missing something easy?

       

      Thank you,

      -Steve

        • 1. Re: 32bit OpenJDK on 64bit OS?
          Wolf-Dieter Fink Master

          You might run a 32-bit JVM on a 64-bit OS. It depends whether there is a 32-bit JVM implementation for this.

          If you find 32 and 64 bit version here http://www.oracle.com.

          1 of 1 people found this helpful
          • 2. Re: 32bit OpenJDK on 64bit OS?
            Steven ONeill Newbie

            Thank you for the response, Wolf.

             

             

            I agree, 32bit JVM on a 64bit OS is entirely normal.   From my experience, Sun JDK/JRE and IBM JDK/JRE accomplish this just fine.

             

             

            In this specific case, I am interested in a 32bit OpenJDK running on a 64bit OS...the OS being a major linux OS distribution such as Redhat or CentOS.

            • 4. Re: 32bit OpenJDK on 64bit OS?
              Steven ONeill Newbie

              I saw no problems in theory either.  In practice, I have thus far been unable to succeed.

               

              Using default repos, for both 64bit CentOS and 64bit RHEL, "yum search openjdk" produces only .x86_64 results.  Instead of .x86_64, I am interested in laying down the 32bit version of OpenJDK on the 64bit OS .i586,.i686 or whatever it might be.  Explicity searching for the same package name but using i586/i686/etc does not turn up any installable packages :-/

              • 5. Re: 32bit OpenJDK on 64bit OS?
                Wolf-Dieter Fink Master

                If you follow the link on the page above you will see the Oracle Download page for JDK7. Here you have Linux..... also as 586 RMP or TAR.

                I suppose that will work.

                 

                As you talk about RHEL, I would contact the Red Hat support and ask what is supported.

                • 6. Re: 32bit OpenJDK on 64bit OS?
                  Steven ONeill Newbie

                  I do plan on following up with RH regarding this as well.

                   

                  Based on past experience, I assume that the Oracle 32bit on 64bit Linux OS will work fine.

                   

                  In this case, I am interested solely in 32bit OpenJDK on 64bit Linux OS. 

                   

                  I do realize that the Oracle JDK, at its core, is or some very high precentage OpenJDK with Oracle extras added on.

                  • 7. Re: 32bit OpenJDK on 64bit OS?
                    Peter Johnson Master

                    Is there a reason why you want to go with the 32-bit OpenJDK and not the 64-bit? Usually, the only reason to go with 32-bit is that your Java app needs to interact with native libraries that are available only in 32-bit.

                     

                    You could try installing 32-bit Fedora or RHEL in a VM and then copying the JDK directory to your 64-bit machine (I have copied JDK directories between machines for years without issue- that's how I can still run 1.3.1!). Of course this will only work if you have 32-bit versions of the various system libraries. (That is sort of a given on Windows, not sure if a 64-bit Linux install would have the 32-bit libraries also.)

                    1 of 1 people found this helpful
                    • 8. Re: 32bit OpenJDK on 64bit OS?
                      Steven ONeill Newbie

                      Peter - I was under the impression that for smaller heaps, under 1.5GB or so, a 32bit JVM is more efficient.  Hence my interest.

                       

                      That is a good point about copying the java directories around...I could probably try to do an install to a 32bit CentOS, RH, or Fedora and try copying it over as a test.   Thanks for the suggestion.

                       

                      At this point, I may just chalk up the 32/64 difference as diminishing anyway and go with 64bit.  Thank you all for the responses.

                      • 9. Re: 32bit OpenJDK on 64bit OS?
                        Peter Johnson Master

                        There is a slight memory benefit to using a 32-bit JDK when using smaller heaps, mainly because the references are 32-bit and not 64-bit. But if I recall correctly, there is an option you can use on a 64-bit JDK to get it to use 32-bit references (and consequently also restrict the size of the heap you can get), though that option is probably only relevant for the Oracle JDK and not OpenJDK (you could check the sources and see, grep the sources for an existing -XX option - you should get one hit, and all of the options are in that same source file). Personally, I wouldn't attempt the hassle with running a 32-bit OpenJDK on Linux, I'd just go with the 64-bit.

                        • 10. Re: 32bit OpenJDK on 64bit OS?
                          Steven ONeill Newbie

                          I recall something similar about using 'compressed references' to improve the small heap performance of 64bit, too.  Regardless, it looks like just matching bits is going to be easier in my case.  Thanks again.