4 Replies Latest reply: Mar 26, 2012 5:52 AM by Olaf Heimburger-Oracle RSS

    CRITICAL: Server ran out of memory in thread

    888557
      Hi, we have process running with jrockit. This is a realtime environment, we following the principal instructions to set the variables and parameters as follow:

      -XXgcthreads:16
      -XgcPrio:deterministic
      -XXcompressedRefs:enable=false
      -Xms3072m
      -Xmx3072m

      but, no matter what values we put in this parameters, the same error is thrown by the virtual machine, causing that our process crash:

      09/14/2011 18:01:49.032 COT Thread-98 (02.012.02) CRITICAL: Server ran out of memory in thread Thread-98 with a heap size of 3,221,225,472
      java.lang.OutOfMemoryError: Resource temporarily unavailable in tsStartJavaThread (lifecycle.c:1096).
      Java heap 3G reserved, 3G committed
      Paged memory=18014398489587228K/72728M.
      Your Java heap size might be set too high.
      Try to reduce the Java heap size using -Xmx:<size> (e.g. "-Xmx
      at java.lang.Thread.start0(Native Method)
      at java.lang.Thread.start(Thread.java:640)


      Settings:

      java version "1.6.0_22"
      Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
      Oracle JRockit(R) (build R28.1.1-14-139783-1.6.0_22-20101206-0241-linux-x86_64, compiled mode)


      Linux 2.6.18-238.el5 x86_64 x86_64 x86_64 GNU/Linux
      LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
      Distributor ID: RedHatEnterpriseServer
      Description: Red Hat Enterprise Linux Server release 5.6 (Tikanga)
      Release: 5.6
      Codename: Tikanga


      What recommendation we can follow? What values we can to set? Some release, could to solve this problem?

      Thanks,

      Mario Zamudio
        • 1. Re: CRITICAL: Server ran out of memory in thread
          René van Wijk
          Try what the message says

          "Your Java heap size might be set too high.
          Try to reduce the Java heap size using -Xmx:<size> (e.g. "-Xmx"

          I do not know how much memory you have in your environment, but can you try
          something like the following: -Xms1024m -Xmx1024m -Xgcprio:deterministic
          • 2. Re: CRITICAL: Server ran out of memory in thread
            888557
            Thanks René, we tested with this values, but the error was the same but with 1024mb, we are checking the memory, appear a strange behavior in the gc, its like a gc can not to release the heap memory, cause the heap used increase the value but dont returns to low values.

            09/16/2011 09:51:42.812 COT Thread-12 (02.010.36) CRITICAL: OutOfMemoryError in thread Thread[Thread-12,5,main] (1,073,741,824 bytes free out of 934 ,040,416)
            java.lang.OutOfMemoryError: Resource temporarily unavailable in tsStartJavaThread (lifecycle.c:1096).
            Java heap 1G reserved, 1G committed
            Paged memory=18014398506755760K/74473536K.
            Your Java heap size might be set too high.
            Try to reduce the Java heap size using -Xmx:<size> (e.g. "-

            We are trying with -XXAggresive mode, the gc is clean the heap of the better way, but we are not sure if this the way. We will test with endurance and stress.


            Best regards,

            Mario

            Edited by: 885554 on 16/09/2011 03:56 PM
            • 3. Re: CRITICAL: Server ran out of memory in thread
              René van Wijk
              When does the error occur?

              Could you just run a simple Java program (with a main method that runs forever) on the command-line and see what happens?

              On the command-line you can use something like: java -Xms1024m -Xmx1024m -Xns256m -Xgc:deterministic -XpauseTarget:100ms some.package.JavaProgram
              • 4. Re: CRITICAL: Server ran out of memory in thread
                Olaf Heimburger-Oracle
                Check your ulimit settings. Maybe your open file limit is too low.

                HTH,
                --olaf