< prev index next >

test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java

Print this page
rev 59103 : imported patch hotspot


  69         ArrayList<String> args = new ArrayList<>();
  70         args.addAll(flags1);
  71         Collections.addAll(args, flags2);
  72 
  73         if (Platform.is64bit()) {
  74             // Explicitly turn off compressed oops
  75             testCompressedOops(args, "-XX:-UseCompressedOops", "-Xmx32m")
  76                 .shouldNotContain("Compressed Oops")
  77                 .shouldHaveExitValue(0);
  78 
  79             // Compressed oops should be on by default
  80             testCompressedOops(args, "-Xmx32m")
  81                 .shouldContain("Compressed Oops mode")
  82                 .shouldHaveExitValue(0);
  83 
  84             // Explicly enabling compressed oops
  85             testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m")
  86                 .shouldContain("Compressed Oops mode")
  87                 .shouldHaveExitValue(0);
  88 
  89             // Skip the following seven test cases if we're on OSX, Windows, or Solaris.
  90             //
  91             // OSX doesn't seem to care about HeapBaseMinAddress.  Windows memory
  92             // locations are affected by ASLR.  Solaris puts the heap way up,
  93             // forcing different behaviour.
  94             if (!Platform.isOSX() && !Platform.isWindows() && !Platform.isSolaris()) {
  95 
  96                 // Larger than 4gb heap should result in zero based with shift 3
  97                 testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx5g")
  98                     .shouldContain("Zero based")
  99                     .shouldContain("Oop shift amount: 3")
 100                     .shouldHaveExitValue(0);
 101 
 102                 // Larger than 3gb heap and HeapBaseMinAddress=1g should result in zero based with shift 3
 103                 testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx3200m", "-XX:HeapBaseMinAddress=1g")
 104                     .shouldContain("Zero based")
 105                     .shouldContain("Oop shift amount: 3")
 106                     .shouldHaveExitValue(0);
 107 
 108                 // Small heap above 4gb should result in zero based with shift 3
 109                 testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=4g")
 110                     .shouldContain("Zero based")
 111                     .shouldContain("Oop shift amount: 3")
 112                     .shouldHaveExitValue(0);
 113 
 114                 // Small heap above 32gb should result in non-zero based with shift 3




  69         ArrayList<String> args = new ArrayList<>();
  70         args.addAll(flags1);
  71         Collections.addAll(args, flags2);
  72 
  73         if (Platform.is64bit()) {
  74             // Explicitly turn off compressed oops
  75             testCompressedOops(args, "-XX:-UseCompressedOops", "-Xmx32m")
  76                 .shouldNotContain("Compressed Oops")
  77                 .shouldHaveExitValue(0);
  78 
  79             // Compressed oops should be on by default
  80             testCompressedOops(args, "-Xmx32m")
  81                 .shouldContain("Compressed Oops mode")
  82                 .shouldHaveExitValue(0);
  83 
  84             // Explicly enabling compressed oops
  85             testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m")
  86                 .shouldContain("Compressed Oops mode")
  87                 .shouldHaveExitValue(0);
  88 
  89             // Skip the following seven test cases if we're on OSX or Windows.
  90             //
  91             // OSX doesn't seem to care about HeapBaseMinAddress.  Windows memory
  92             // locations are affected by ASLR.
  93             if (!Platform.isOSX() && !Platform.isWindows()) {

  94 
  95                 // Larger than 4gb heap should result in zero based with shift 3
  96                 testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx5g")
  97                     .shouldContain("Zero based")
  98                     .shouldContain("Oop shift amount: 3")
  99                     .shouldHaveExitValue(0);
 100 
 101                 // Larger than 3gb heap and HeapBaseMinAddress=1g should result in zero based with shift 3
 102                 testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx3200m", "-XX:HeapBaseMinAddress=1g")
 103                     .shouldContain("Zero based")
 104                     .shouldContain("Oop shift amount: 3")
 105                     .shouldHaveExitValue(0);
 106 
 107                 // Small heap above 4gb should result in zero based with shift 3
 108                 testCompressedOops(args, "-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=4g")
 109                     .shouldContain("Zero based")
 110                     .shouldContain("Oop shift amount: 3")
 111                     .shouldHaveExitValue(0);
 112 
 113                 // Small heap above 32gb should result in non-zero based with shift 3


< prev index next >