Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6645868

java -Xss not properly set

XMLWordPrintable

    • sparc
    • solaris_8

      The customer test if Java -Xss option correctly reflected
      by using the following program until OutOfMemoryError occurs.

      public class ThreadTest extends Thread {
        static int tcnt = 0;
        public static void main(String[] args) {
          try {
            while (true) {
              ThreadTest x = new ThreadTest();
                x.start();
                tcnt++;
                System.out.println(tcnt);
            }
          } catch (Throwable e) {
            e.printStackTrace();
          }
        }

        public void run() {
          try {
            Thread.sleep(1000*3600);
          } catch (InterruptedException ie) {
            ie.printStackTrace();
          }
        }
      }

      They invoked this program by:

      java -Xms2048m -Xmx2048m -XX:PermSize=128m -XX:MaxPermSize=128m -Xss<variable> ThreadTest

      and checked the JVM process memory size from ps command VSZ/NLWP output.
      Physical memory was 4GB.

      The result of the test seems to be:

      1. -Xss between 512k and 768k not seems to set correctly
      2. memory usage amount is almost same with -Xss on RHEL,
         but far different on Solaris 8.

            zgu Zhengyu Gu
            hinozaki Hiroaki Nozaki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: