author | iignatyev |
Wed, 02 May 2018 16:43:56 -0700 | |
changeset 49958 | cc29d7717e3a |
permissions | -rw-r--r-- |
49958
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
1 |
/* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
4 |
* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
8 |
* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
13 |
* accompanied this code). |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
14 |
* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
18 |
* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
21 |
* questions. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
22 |
*/ |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
23 |
|
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
24 |
|
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
25 |
/* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
26 |
* @test |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
27 |
* @key stress |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
28 |
* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
29 |
* @summary converted from VM Testbase nsk/monitoring/stress/lowmem/lowmem032. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
30 |
* VM Testbase keywords: [stress, monitoring, nonconcurrent] |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
31 |
* VM Testbase readme: |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
32 |
* DESCRIPTION |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
33 |
* The test checks that enabling of low memory detection does not lead to |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
34 |
* unexpected behaviour: crashes of the VM and undocumented exceptions. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
35 |
* The test enables low memory detection: it adds NotificationListener |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
36 |
* to the MemoryMBean for notification mechanism of monitoring, or starts |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
37 |
* a special thread for polling mechanism. After that, it starts eating memory. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
38 |
* Objects are allocated, if "heap" memory is tested; classes are loaded, |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
39 |
* if "nonheap" memory is tested; objects are allocated and classes are |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
40 |
* loaded, if "mixed" memory is tested. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
41 |
* Notifications are received by the listener in notification mechanism and |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
42 |
* crossing of thresholds are detected in polling mechanism. The thresholds |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
43 |
* are updated as soon as notification is received, or crossing of a threshold |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
44 |
* is detected. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
45 |
* The test also checks stderr to be empty. Otherwise, it fails. The test |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
46 |
* exits as soon as OutOfMemoryError is caught (if heap memory is tested) or |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
47 |
* all classes are loaded (if nonheap or mixed memory is tested). |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
48 |
* All options of the test are specified in *.cfg file. this particular test |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
49 |
* - performs access to the MBeans' method through default MBeanServer; |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
50 |
* - fills nonheap memory; |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
51 |
* - implements polling mechanism of monitoring; |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
52 |
* - tests collection usage thresholds. |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
53 |
* COMMENTS |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
54 |
* Fixed the bug |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
55 |
* 4969687 TEST_BUG: The spec is updated accoring to 4956978, 4957000, 4959889 |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
56 |
* |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
57 |
* @library /vmTestbase |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
58 |
* /test/lib |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
59 |
* @run driver jdk.test.lib.FileInstaller . . |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
60 |
* @run main/othervm |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
61 |
* -XX:-UseGCOverheadLimit |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
62 |
* nsk.monitoring.stress.lowmem.lowmem001 |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
63 |
* -testMode=server |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
64 |
* -memory=nonheap |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
65 |
* -monitoring=polling |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
66 |
* -threshold=collection |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
67 |
*/ |
cc29d7717e3a
8199375: [TESTBUG] Open source vm testbase monitoring tests
iignatyev
parents:
diff
changeset
|
68 |