changeset 53935:f3d5dcb6924b

8214840: runtime/NMT/MallocStressTest.java timed out Summary: Add volatile to declaration of static field shared by multiple threads Reviewed-by: dcubed, dholmes, coleenp
author hseigel
date Fri, 07 Dec 2018 08:16:50 -0500
parents 495c05ee2a9a
children 325c95779368
files test/hotspot/jtreg/runtime/NMT/MallocStressTest.java
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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();