1 2 Previous Next 18 Replies Latest reply on May 5, 2009 12:51 PM by phennig Go to original post
      • 15. java.lang.OutOfMemoryError: PermGen space
        dilembo

        hi all
        i'm using jboss 4.2.1 and hibernate as persistence framework.
        We have a huge database and a lots of hbm file for mapping them.
        So when i run jboss during built session factory i get java.lang.OutOfMemoryError: PermGen space
        cause i have to much hbm.I already increased permgen size launching jboss but nothing chance.
        Exists a way for optimize hibernate and jboss memory usage?
        i know that this is not hibernate forum but there is quite hard getting credits for posting problems.
        Regards
        Giovanni

        • 16. Re: java.lang.OutOfMemoryError: PermGen space
          adeolink

          excuse the german of the following link: read the comment to the blog:
          http://blog.meimberg.info/?p=207

          • 17. DANGER !!!!!! BE CAREFUL OF LD_ASSUME_KERNEL=2.1.4 ABOVE


            DANGER !!!!!

            BE CAREFUL OF SETTING LD_ASSUME_KERNEL=2.1.4 ABOVE in newer Linux distros like Fedora 4 upwards etc

            PLEASE BE CAREFUL OR YOU WILL CRASH YOUR MACHINE AND FAIL TO LOGIN



            What is LD_ASSUME_KERNEL

            A while back a environment variable was introduced (mostly) to allow users to control how Linux handled threading issues. All sorts of applications (in particular Java) started telling users to set this LD_ASSUME_KERNEL variable. If you still have this variable set in Fedora Core 4, you are looking for trouble.
            *****It’s true, I ngonidan crashed our Proxy server at office because I set the variable to
            export LD_ASSUME_KERNEL=2.1.4
            **********************
            When Linux was changing threading models the new threading model broke several applications (in particular Java) and so they added a variable you could set to get the old threading behavior. Many people just added this to their .profile or login to always allow things like Java to work.
            Another application that had issues at one point with the threading model was rpm. After some upgrades you would need to set LD_ASSUME_KERNEL to some particular value to get rpm to work at all.
            At some times during the transition, mozilla/firefox needed LD_ASSUME_KERNEL to properly run. Those days are long past.
            This was all well and good for transition to a new threading model/abi, but this has long since been completed. If you have LD_ASSUME_KERNEL set in Fedora Core you will see nifty errors like:
            /usr/lib/openoffice.org2.0/program/javaldx: /lib/obsolete/linuxthreads/libpthread.so.0: version `GLIBC_2.3.3' not found
            and
            rpmdb: unable to initialize mutex: Function not implemented. error: cannot open Name index using db3 - Function not implemented (38)
            The solution is of course to go through all your personal init files and make sure you remove any mention of LD_ASSUME_KERNEL. Including .profile, .bashrc, etc.


            How did I Ngonidan solve the crash
            NOW, soon after setting export LD_ASSUME_KERNEL=2.1.4 in bashrc, I could not login as root. This meant the whole machine users were in trouble. Now I got a tip to use a failsafe session, which is kind of a safe mode for linux. BUT, commands Do NOT work as expected e.g. programs like vi, etc. I think it’s coz programs/services are not loaded so what I did, I thought of using the append commands. I booted linux, took note of Fedora Kernel 2.6.18-1.2798.fc6
            Solution- was to simply append another environment variable soon after that erroneous line, which meant that will be the variable which will be loaded
            # echo export LD_ASSUME_KERNEL=2.6.18-1.2798.fc6 >> /etc/bashrc
            That’s it. Disaster recovered, will never play again with LD_ASSUME_KERNEL !!!!!!!!


            If above fails Try using an Ubuntu Live CD to go in and edit the file and save and reboot machine. But for me Ubuntu Live CD took too long or actually failed to startup my machine

            • 18. Re: java.lang.OutOfMemoryError: PermGen space

              You can configure the PermGen Space with this Parameters:
              -XX:PermSize=256m -XX:MaxPermSize=1024m

              http://www.brokenbuild.com/blog/2006/08/04/java-jvm-gc-permgen-and-memory-options/

              1 2 Previous Next