< prev index next >

test/gc/arguments/TestNewSizeThreadIncrease.java

Print this page




   9 * This code is distributed in the hope that it will be useful, but WITHOUT
  10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 * version 2 for more details (a copy is included in the LICENSE file that
  13 * accompanied this code).
  14 *
  15 * You should have received a copy of the GNU General Public License version
  16 * 2 along with this work; if not, write to the Free Software Foundation,
  17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 *
  19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 * or visit www.oracle.com if you need additional information or have any
  21 * questions.
  22 */
  23 
  24 /*
  25  * @test TestNewSizeThreadIncrease
  26  * @key gc
  27  * @bug 8144527
  28  * @summary Tests argument processing for NewSizeThreadIncrease
  29  * @library /testlibrary
  30  * @requires vm.gc.Serial
  31  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  */
  34 
  35 
  36 import jdk.test.lib.*;



  37 
  38 // Range of NewSizeThreadIncrease is 0 ~ max_uintx.
  39 // Total of 5 threads will be created (1 GCTest thread and 4 TestThread).
  40 public class TestNewSizeThreadIncrease {
  41   static final String VALID_VALUE = "2097152"; // 2MB
  42 
  43   // This value will make an overflow of 'thread count * NewSizeThreadIncrease' at DefNewGeneration::compute_new_size().
  44   // = (max_uintx / 5) + 1, = (18446744073709551615 / 5) + 1
  45   static String INVALID_VALUE_1 = "3689348814741910324";
  46 
  47   // This string is contained when compute_new_size() expands or shrinks.
  48   static final String LOG_NEWSIZE_CHANGED = "New generation size ";
  49 
  50   public static void main(String[] args) throws Exception {
  51     if (Platform.is32bit()) {
  52       // (max_uintx / 5) + 1, 4294967295/5 + 1
  53       INVALID_VALUE_1 = "858993460";
  54     }
  55 
  56     // New size will be applied as NewSizeThreadIncrease is small enough to expand.




   9 * This code is distributed in the hope that it will be useful, but WITHOUT
  10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 * version 2 for more details (a copy is included in the LICENSE file that
  13 * accompanied this code).
  14 *
  15 * You should have received a copy of the GNU General Public License version
  16 * 2 along with this work; if not, write to the Free Software Foundation,
  17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 *
  19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 * or visit www.oracle.com if you need additional information or have any
  21 * questions.
  22 */
  23 
  24 /*
  25  * @test TestNewSizeThreadIncrease
  26  * @key gc
  27  * @bug 8144527
  28  * @summary Tests argument processing for NewSizeThreadIncrease
  29  * @library /test/lib
  30  * @requires vm.gc.Serial
  31  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  */
  34 
  35 
  36 import jdk.test.lib.Platform;
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 import jdk.test.lib.process.ProcessTools;
  39 
  40 
  41 // Range of NewSizeThreadIncrease is 0 ~ max_uintx.
  42 // Total of 5 threads will be created (1 GCTest thread and 4 TestThread).
  43 public class TestNewSizeThreadIncrease {
  44   static final String VALID_VALUE = "2097152"; // 2MB
  45 
  46   // This value will make an overflow of 'thread count * NewSizeThreadIncrease' at DefNewGeneration::compute_new_size().
  47   // = (max_uintx / 5) + 1, = (18446744073709551615 / 5) + 1
  48   static String INVALID_VALUE_1 = "3689348814741910324";
  49 
  50   // This string is contained when compute_new_size() expands or shrinks.
  51   static final String LOG_NEWSIZE_CHANGED = "New generation size ";
  52 
  53   public static void main(String[] args) throws Exception {
  54     if (Platform.is32bit()) {
  55       // (max_uintx / 5) + 1, 4294967295/5 + 1
  56       INVALID_VALUE_1 = "858993460";
  57     }
  58 
  59     // New size will be applied as NewSizeThreadIncrease is small enough to expand.


< prev index next >