< prev index next >

test/java/lang/management/MemoryMXBean/LowMemoryTest.java

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


  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
  26  * @bug     4530538
  27  * @summary Basic unit test of memory management testing:
  28  *          1) setUsageThreshold() and getUsageThreshold()
  29  *          2) test low memory detection on the old generation.
  30  *
  31  * @author  Mandy Chung
  32  *
  33  * @library /lib/testlibrary/
  34  * @modules java.management
  35  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
  36  * @run main/timeout=600 LowMemoryTest
  37  * @requires vm.gc == "null"
  38  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  39  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  40  * @requires vm.opt.DisableExplicitGC != "true"




  41  */
  42 
  43 import java.lang.management.*;
  44 import java.util.*;
  45 import java.util.concurrent.Phaser;
  46 import javax.management.*;
  47 import javax.management.openmbean.CompositeData;
  48 import jdk.testlibrary.ProcessTools;
  49 import jdk.testlibrary.JDKToolFinder;
  50 import jdk.testlibrary.Utils;
  51 
  52 public class LowMemoryTest {
  53     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
  54     private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
  55     private static final Phaser phaser = new Phaser(2);
  56     private static MemoryPoolMXBean mpool = null;
  57     private static boolean trace = false;
  58     private static boolean testFailed = false;
  59     private static final int NUM_TRIGGERS = 5;
  60     private static final int NUM_CHUNKS = 2;




  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
  26  * @bug     4530538
  27  * @summary Basic unit test of memory management testing:
  28  *          1) setUsageThreshold() and getUsageThreshold()
  29  *          2) test low memory detection on the old generation.

  30  * @author  Mandy Chung
  31  *




  32  * @requires vm.gc == "null"
  33  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  34  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  35  * @requires vm.opt.DisableExplicitGC != "true"
  36  * @library /lib/testlibrary/
  37  *
  38  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
  39  * @run main/timeout=600 LowMemoryTest
  40  */
  41 
  42 import java.lang.management.*;
  43 import java.util.*;
  44 import java.util.concurrent.Phaser;
  45 import javax.management.*;
  46 import javax.management.openmbean.CompositeData;
  47 import jdk.testlibrary.ProcessTools;
  48 import jdk.testlibrary.JDKToolFinder;
  49 import jdk.testlibrary.Utils;
  50 
  51 public class LowMemoryTest {
  52     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
  53     private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
  54     private static final Phaser phaser = new Phaser(2);
  55     private static MemoryPoolMXBean mpool = null;
  56     private static boolean trace = false;
  57     private static boolean testFailed = false;
  58     private static final int NUM_TRIGGERS = 5;
  59     private static final int NUM_CHUNKS = 2;


< prev index next >