< prev index next >

test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java

Print this page
rev 16783 : 8176176: fix @modules in jdk_svc tests
Reviewed-by: duke


  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  * The -XX:MarkSweepAlwaysCompactCount=1 argument below makes sure serial gc
  26  * compacts the heap at every full gc so that the usage is correctly updated.
  27  */
  28 
  29 /*
  30  * @test
  31  * @bug     4892507
  32  * @summary Basic Test for MemoryPool.resetPeakUsage()
  33  * @author  Mandy Chung
  34  *



  35  * @library /lib/testlibrary/
  36  * @modules jdk.management

  37  * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
  38  * @run main ResetPeakMemoryUsage
  39  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  40  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  41  * @requires vm.opt.DisableExplicitGC != "true"
  42  */
  43 
  44 import java.lang.management.*;
  45 import java.lang.ref.WeakReference;
  46 import java.util.*;
  47 
  48 public class ResetPeakMemoryUsage {
  49     private static MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
  50     // make public so that it can't be optimized away easily
  51     public static Object[] obj;
  52 
  53     /**
  54      * Run the test multiple times with different GC versions.
  55      * First with default command line specified by the framework.
  56      * Then with all GC versions specified by the test.
  57      */
  58     public static void main(String a[]) throws Throwable {
  59         final String main = "ResetPeakMemoryUsage$TestMain";
  60         final String ms = "-Xms256m";
  61         final String mn = "-Xmn8m";




  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  * The -XX:MarkSweepAlwaysCompactCount=1 argument below makes sure serial gc
  26  * compacts the heap at every full gc so that the usage is correctly updated.
  27  */
  28 
  29 /*
  30  * @test
  31  * @bug     4892507
  32  * @summary Basic Test for MemoryPool.resetPeakUsage()
  33  * @author  Mandy Chung
  34  *
  35  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  36  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  37  * @requires vm.opt.DisableExplicitGC != "true"
  38  * @library /lib/testlibrary/
  39  * @modules jdk.management
  40  *
  41  * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
  42  * @run main ResetPeakMemoryUsage



  43  */
  44 
  45 import java.lang.management.*;
  46 import java.lang.ref.WeakReference;
  47 import java.util.*;
  48 
  49 public class ResetPeakMemoryUsage {
  50     private static MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
  51     // make public so that it can't be optimized away easily
  52     public static Object[] obj;
  53 
  54     /**
  55      * Run the test multiple times with different GC versions.
  56      * First with default command line specified by the framework.
  57      * Then with all GC versions specified by the test.
  58      */
  59     public static void main(String a[]) throws Throwable {
  60         final String main = "ResetPeakMemoryUsage$TestMain";
  61         final String ms = "-Xms256m";
  62         final String mn = "-Xmn8m";


< prev index next >