comparison test/gc/arguments/TestMaxHeapSizeTools.java @ 13060:8f07aa079343

8016309: assert(eden_size > 0 && survivor_size > 0) failed: just checking 7057939: jmap shows MaxNewSize=4GB when Java is using parallel collector Summary: Major cleanup of the collectorpolicy classes Reviewed-by: tschatzl, jcoomes
author jwilhelm
date Fri, 01 Nov 2013 17:09:38 +0100
parents 7a95933197d0
children 6827d470020d
comparison
equal deleted inserted replaced
13059:46d7652b223c 13060:8f07aa079343
62 62
63 // we check cases with values smaller and larger than this default value. 63 // we check cases with values smaller and larger than this default value.
64 long newPlusOldSize = values[0] + values[1]; 64 long newPlusOldSize = values[0] + values[1];
65 long smallValue = newPlusOldSize / 2; 65 long smallValue = newPlusOldSize / 2;
66 long largeValue = newPlusOldSize * 2; 66 long largeValue = newPlusOldSize * 2;
67 long maxHeapSize = largeValue + (2 * 1024 * 1024);
67 68
68 // -Xms is not set 69 // -Xms is not set
69 checkErgonomics(new String[] { gcflag, "-Xmx16M" }, values, -1, -1); 70 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize }, values, -1, -1);
70 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-XX:InitialHeapSize=" + smallValue }, values, smallValue, smallValue); 71 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-XX:InitialHeapSize=" + smallValue }, values, -1, smallValue);
71 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-XX:InitialHeapSize=" + largeValue }, values, -1, largeValue); 72 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-XX:InitialHeapSize=" + largeValue }, values, -1, largeValue);
72 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-XX:InitialHeapSize=0" }, values, -1, -1); 73 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-XX:InitialHeapSize=0" }, values, -1, -1);
73 74
74 // -Xms is set to zero 75 // -Xms is set to zero
75 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms0" }, values, -1, -1); 76 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms0" }, values, -1, -1);
76 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms0", "-XX:InitialHeapSize=" + smallValue }, values, smallValue, smallValue); 77 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms0", "-XX:InitialHeapSize=" + smallValue }, values, -1, smallValue);
77 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms0", "-XX:InitialHeapSize=" + largeValue }, values, -1, largeValue); 78 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms0", "-XX:InitialHeapSize=" + largeValue }, values, -1, largeValue);
78 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms0", "-XX:InitialHeapSize=0" }, values, -1, -1); 79 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms0", "-XX:InitialHeapSize=0" }, values, -1, -1);
79 80
80 // -Xms is set to small value 81 // -Xms is set to small value
81 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + smallValue }, values, -1, -1); 82 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms" + smallValue }, values, -1, -1);
82 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + smallValue, "-XX:InitialHeapSize=" + smallValue }, values, smallValue, smallValue); 83 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms" + smallValue, "-XX:InitialHeapSize=" + smallValue }, values, smallValue, smallValue);
83 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + smallValue, "-XX:InitialHeapSize=" + largeValue }, values, smallValue, largeValue); 84 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms" + smallValue, "-XX:InitialHeapSize=" + largeValue }, values, smallValue, largeValue);
84 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + smallValue, "-XX:InitialHeapSize=0" }, values, smallValue, -1); 85 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms" + smallValue, "-XX:InitialHeapSize=0" }, values, smallValue, -1);
85 86
86 // -Xms is set to large value 87 // -Xms is set to large value
87 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + largeValue }, values, largeValue, largeValue); 88 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms" + largeValue }, values, largeValue, largeValue);
88 // the next case has already been checked elsewhere and gives an error 89 checkErgonomics(new String[] { gcflag, "-Xmx" + maxHeapSize, "-Xms" + largeValue, "-XX:InitialHeapSize=0" }, values, largeValue, -1);
89 // checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + largeValue, "-XX:InitialHeapSize=" + smallValue }, values, smallValue, smallValue);
90 // the next case has already been checked elsewhere too
91 // checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + largeValue, "-XX:InitialHeapSize=" + largeValue }, values, values[0], largeValue);
92 checkErgonomics(new String[] { gcflag, "-Xmx16M", "-Xms" + largeValue, "-XX:InitialHeapSize=0" }, values, largeValue, -1);
93 } 90 }
94 91
95 private static long align_up(long value, long alignment) { 92 private static long align_up(long value, long alignment) {
96 long alignmentMinusOne = alignment - 1; 93 long alignmentMinusOne = alignment - 1;
97 return (value + alignmentMinusOne) & ~alignmentMinusOne; 94 return (value + alignmentMinusOne) & ~alignmentMinusOne;