8 Replies Latest reply on Dec 13, 2010 4:57 PM by Peter Johnson

    shutdown.sh Could not reserve enough space for object heap

    Wendell Hatcher Newbie

      Hello,

       

            I am running solaris 10 with a 16 gig  heap. I am receiving the following error when I try stopping my deployed  application. I am only using 5 gig on the JAVA_OPTS heap and am not  using all of the physical memory?

       

      Could not reserve enough space for object heap

       

      JAVA_OPTS="-Xms5120M  -Xmx5120M -server -XX:+AggressiveHeap -XX:ParallelGCThreads=6  -Djava.awt.headless=true -d64 -XX:MaxPermSize=256m -XX:PermSize=256m  -Dsun.rmi.dgc.client.gcInterval=1800000 -Dsun.rmi.dgc.server.gcInterval=1800000"

       

       

      load averages:  0.67,  0.73,   0.55;                    up  126+23:41:03                                                                               21:03:40
      41 processes: 40 sleeping, 1 on cpu
      CPU states: 99.4% idle,  0.2% user,  0.5% kernel,  0.0% iowait,  0.0% swap
      Memory: 16G phys mem, 5280M free mem, 8193M total swap, 7661M free swap

       

      Could not reserve enough space for object heap

        • 1. Re: shutdown.sh Could not reserve enough space for object heap
          jaikiran pai Master

          You don't need that much memory for triggering a shutdown. Don't set the JAVA_OPTS and instead just run the unchanged shutdown.sh

          • 2. Re: shutdown.sh Could not reserve enough space for object heap
            Wendell Hatcher Newbie

            The problem is that I am receving the heap memory error when the shutting down the application. The amount of memory on the server 16 gig so i have plenty of memory. It doesnt matter how much memory I am not trying to use it to shut down the application. The problem is we are getting this strange error when shutting down the app.

            • 3. Re: shutdown.sh Could not reserve enough space for object heap
              Wolf-Dieter Fink Master

              run.sh is your start script that (I suppose) use this 5GB setting.

              If you call shutdown.sh the JVM of JBoss is still running with 5GB memory and the JVM for shutdown is set up also with 5GB, in fact that might be too much, or you call acidental a 32Bit JVM.

               

              An other way to stop might be a Unix kill ;-)

              • 4. Re: shutdown.sh Could not reserve enough space for object heap
                Wendell Hatcher Newbie

                We have to do a hardkill on the process pkill -U this does stop the application but it doesnt solve our problem. I am thinking the shutdown.sh process is having problems destroying large object in the heap. This is a 64bit jvm and I dont think it is a jvm heap problem.

                 

                java -d64 -Xmx6G -version

                java version "1.6.0_01"

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

                Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_01-b06, mixed mode)

                • 5. Re: shutdown.sh Could not reserve enough space for object heap
                  Peter Johnson Master

                  1.6.0_01 is an ancient version of JDK 6, I strongly recommend upgrading to a more recent version.

                   

                  The error "Could not reserve enough space for object heap" means that there is not enough available memory on the system to allocate the heap and permgen. Notice the amount of free memory:

                   

                  Memory: 16G phys mem, 5280M free mem, 8193M total swap, 7661M free swap

                   

                  Though why it did not consider the availabvle swap space I have no idea. Anyway, Wolf-Dieter's suggestion to not use a 5GB heap when running shutdown.sh is the best (it could probably run with as little as 64MB). You will probably have to modify shutdown.sh to not get its heap settings from run.conf.

                   

                  By the way, the -XX:+AggressiveHeap is not recommended for app servers. This option is specifically used by the HotSpot team for tuning the JVM to run the SPECjbb benchmark, which is a memory and CPU intensive benchmark (there are no IOs). The settings it makes are not optimal for an application server such as JBoss AS.

                   

                  Regarding -XX:ParallelGCThreads=6, how many CPUs do you have. Hopefully more than 6; if not, the gc will run slower.

                  • 6. Re: shutdown.sh Could not reserve enough space for object heap
                    Wendell Hatcher Newbie

                    Thanks for the info! :-) I have one physical cpu and what looks like 31 virtual although I am not sure exactly what that means?

                     

                    psrinfo
                    0       on-line   since 08/07/2010 22:20:21
                    1       on-line   since 08/07/2010 22:20:24
                    2       on-line   since 08/07/2010 22:20:24
                    3       on-line   since 08/07/2010 22:20:24
                    4       on-line   since 08/07/2010 22:20:24
                    5       on-line   since 08/07/2010 22:20:24
                    6       on-line   since 08/07/2010 22:20:24
                    7       on-line   since 08/07/2010 22:20:24
                    8       on-line   since 08/07/2010 22:20:25
                    9       on-line   since 08/07/2010 22:20:25
                    10      on-line   since 08/07/2010 22:20:25
                    11      on-line   since 08/07/2010 22:20:25
                    12      on-line   since 08/07/2010 22:20:25
                    13      on-line   since 08/07/2010 22:20:25
                    14      on-line   since 08/07/2010 22:20:25
                    15      on-line   since 08/07/2010 22:20:25
                    16      on-line   since 08/07/2010 22:20:25
                    17      on-line   since 08/07/2010 22:20:25
                    18      on-line   since 08/07/2010 22:20:25
                    19      on-line   since 08/07/2010 22:20:25
                    20      on-line   since 08/07/2010 22:20:25
                    21      on-line   since 08/07/2010 22:20:25
                    22      on-line   since 08/07/2010 22:20:25
                    23      on-line   since 08/07/2010 22:20:25
                    24      on-line   since 08/07/2010 22:20:25
                    25      on-line   since 08/07/2010 22:20:25
                    26      on-line   since 08/07/2010 22:20:25
                    27      on-line   since 08/07/2010 22:20:25
                    28      on-line   since 08/07/2010 22:20:25
                    29      on-line   since 08/07/2010 22:20:25
                    30      on-line   since 08/07/2010 22:20:25
                    31      on-line   since 08/07/2010 22:20:25
                    ccm11:/usr/local/ccjb1/jboss/bin$ sudo -u ccjb1 uname -a
                    SunOS ccm11 5.10 Generic_142900-08 sun4v sparc SUNW,Sun-Fire-T200

                     

                    psrinfo -p
                    1

                    • 7. Re: shutdown.sh Could not reserve enough space for object heap
                      Wendell Hatcher Newbie

                      Also,  how and where do I make the change inside of the shutdown.sh script to have it only use 64M instead of what is inside of the run.conf file?

                       

                       

                      # Read an optional running configuration file
                      if [ "x$RUN_CONF" = "x" ]; then
                          RUN_CONF="$DIRNAME/run.conf"
                      fi
                      if [ -r $RUN_CONF ]; then
                          . $RUN_CONF
                      fi

                      • 8. Re: shutdown.sh Could not reserve enough space for object heap
                        Peter Johnson Master

                        Oh, that's right, you are on SPARC. I have no idea what the recommendation is for GC thread count on SPARC. You could always remove -XX:ParallelGCThreads and see how many you end up with. If less than 6, leave the -XX:ParallelGCThreads option off. If more than six, turn it back on.

                         

                        I thought for sure that shutdwon.sh called run.conf, but it doesn't look like it does. Instead, it uses JAVA_OPTS to set the options. Do you have that set? If that doesn't help, you will have to echo the "exec" done at the end of shutdown.sh to see what parameters are being passed to the JVM. If that doesn't help, set _JAVA_LAUNCHER_DEBUG, that will print out information about what is being passed ot the JVM.