changeset 48206:6cd25cd7df81

8193159: Reduce the number of classes loaded due to NativeLibrary Reviewed-by: alanb, redestad, martin
author mchung
date Thu, 07 Dec 2017 09:22:35 -0800
parents b27d2f69e552
children 8b967e200e35
files src/java.base/share/classes/java/lang/ClassLoader.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Thu Dec 07 08:56:04 2017 -0800
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Thu Dec 07 09:22:35 2017 -0800
@@ -38,6 +38,7 @@
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
 import java.security.cert.Certificate;
+import java.util.ArrayDeque;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Deque;
@@ -45,7 +46,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
-import java.util.LinkedList;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Objects;
@@ -2496,7 +2496,7 @@
         }
 
         // native libraries being loaded
-        static Deque<NativeLibrary> nativeLibraryContext = new LinkedList<>();
+        static Deque<NativeLibrary> nativeLibraryContext = new ArrayDeque<>(8);
 
         /*
          * The run() method will be invoked when this class loader becomes