< prev index next >

test/hotspot/jtreg/runtime/Thread/TooSmallStackSize.java

Print this page
rev 54472 : 8222334: java -Xss0 triggers StackOverflowError
Summary: Launcher to use the ThreadStackSize decided by hotpot or system if input is 0
Reviewed-by: dholmes


 170         checkStack("-XX:ThreadStackSize=", ThreadStackSizeString, "16");
 171 
 172         /*
 173          * Try with a 64k stack size, which is the size that the launcher will
 174          * set to if you try setting to anything smaller. This should produce the same
 175          * result as setting to 16k if the fix for 6762191 is in place.
 176          */
 177         String min_stack_allowed = checkStack("-XX:ThreadStackSize=", ThreadStackSizeString, "64");
 178 
 179         /*
 180          * Try again with a the minimum stack size that was given in the error message
 181          */
 182         checkMinStackAllowed("-XX:ThreadStackSize=", ThreadStackSizeString, min_stack_allowed);
 183 
 184         /*
 185          * Now try with a stack size that is not page aligned.
 186          */
 187         checkMinStackAllowed("-XX:ThreadStackSize=", ThreadStackSizeString, "513");
 188 
 189         /*





 190          * Now redo the same tests with the compiler thread stack size:
 191          */
 192         checkStack("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "16");
 193         min_stack_allowed = checkStack("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "64");
 194         checkMinStackAllowed("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, min_stack_allowed);
 195         checkMinStackAllowed("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "513");

 196 
 197         /*
 198          * Now redo the same tests with the VM thread stack size:
 199          */
 200         checkStack("-XX:VMThreadStackSize=", VMThreadStackSizeString, "16");
 201         min_stack_allowed = checkStack("-XX:VMThreadStackSize=", VMThreadStackSizeString, "64");
 202         checkMinStackAllowed("-XX:VMThreadStackSize=", VMThreadStackSizeString, min_stack_allowed);
 203         checkMinStackAllowed("-XX:VMThreadStackSize=", VMThreadStackSizeString, "513");

 204     }
 205 }


 170         checkStack("-XX:ThreadStackSize=", ThreadStackSizeString, "16");
 171 
 172         /*
 173          * Try with a 64k stack size, which is the size that the launcher will
 174          * set to if you try setting to anything smaller. This should produce the same
 175          * result as setting to 16k if the fix for 6762191 is in place.
 176          */
 177         String min_stack_allowed = checkStack("-XX:ThreadStackSize=", ThreadStackSizeString, "64");
 178 
 179         /*
 180          * Try again with a the minimum stack size that was given in the error message
 181          */
 182         checkMinStackAllowed("-XX:ThreadStackSize=", ThreadStackSizeString, min_stack_allowed);
 183 
 184         /*
 185          * Now try with a stack size that is not page aligned.
 186          */
 187         checkMinStackAllowed("-XX:ThreadStackSize=", ThreadStackSizeString, "513");
 188 
 189         /*
 190          * Try with 0k which indicates that the default thread stack size from JVM will be used
 191          */
 192         checkMinStackAllowed("-XX:ThreadStackSize=", ThreadStackSizeString, "0");
 193 
 194         /*
 195          * Now redo the same tests with the compiler thread stack size:
 196          */
 197         checkStack("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "16");
 198         min_stack_allowed = checkStack("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "64");
 199         checkMinStackAllowed("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, min_stack_allowed);
 200         checkMinStackAllowed("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "513");
 201         checkMinStackAllowed("-XX:CompilerThreadStackSize=", CompilerThreadStackSizeString, "0");
 202 
 203         /*
 204          * Now redo the same tests with the VM thread stack size:
 205          */
 206         checkStack("-XX:VMThreadStackSize=", VMThreadStackSizeString, "16");
 207         min_stack_allowed = checkStack("-XX:VMThreadStackSize=", VMThreadStackSizeString, "64");
 208         checkMinStackAllowed("-XX:VMThreadStackSize=", VMThreadStackSizeString, min_stack_allowed);
 209         checkMinStackAllowed("-XX:VMThreadStackSize=", VMThreadStackSizeString, "513");
 210         checkMinStackAllowed("-XX:VMThreadStackSize=", VMThreadStackSizeString, "0");
 211     }
 212 }
< prev index next >