8214840: runtime/NMT/MallocStressTest.java timed out
authorhseigel
Fri, 07 Dec 2018 08:16:50 -0500
changeset 52898 f3d5dcb6924b
parent 52897 495c05ee2a9a
child 52899 325c95779368
8214840: runtime/NMT/MallocStressTest.java timed out Summary: Add volatile to declaration of static field shared by multiple threads Reviewed-by: dcubed, dholmes, coleenp
test/hotspot/jtreg/runtime/NMT/MallocStressTest.java
--- a/test/hotspot/jtreg/runtime/NMT/MallocStressTest.java	Fri Dec 07 13:54:45 2018 +0100
+++ b/test/hotspot/jtreg/runtime/NMT/MallocStressTest.java	Fri Dec 07 08:16:50 2018 -0500
@@ -57,21 +57,19 @@
         release
     };
 
-    static TestPhase phase = TestPhase.alloc;
+    static volatile TestPhase phase = TestPhase.alloc;
 
     // malloc'd memory
-    static ArrayList<MallocMemory>  mallocd_memory = new ArrayList<MallocMemory>();
+    static final ArrayList<MallocMemory>  mallocd_memory = new ArrayList<MallocMemory>();
     static long                     mallocd_total  = 0;
     static WhiteBox                 whiteBox;
     static AtomicInteger            pause_count = new AtomicInteger();
 
-    static boolean                  is_64_bit_system;
+    static final boolean            is_64_bit_system = Platform.is64bit();
 
     private static boolean is_64_bit_system() { return is_64_bit_system; }
 
     public static void main(String args[]) throws Exception {
-        is_64_bit_system = (Platform.is64bit());
-
         OutputAnalyzer output;
         whiteBox = WhiteBox.getWhiteBox();