/* ThreadLocal values pertaining to this thread. This map is maintained * by the ThreadLocal class. */ ThreadLocal.ThreadLocalMap threadLocals = null;
/* * InheritableThreadLocal values pertaining to this thread. This map is * maintained by the InheritableThreadLocal class. */ ThreadLocal.ThreadLocalMap inheritableThreadLocals = null;
1 2 3
if (parent.inheritableThreadLocals != null) this.inheritableThreadLocals = ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=200m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
这个参数,与-Xmn or (-XX:NewSize and -XX:MaxNewSize) or -XX:NewRatio并列,都是设置年轻代大小。默认值为2, 也就是新生代占堆大小的1/3, 个人喜欢把对半分, 增大新生代的大小,能减少GC的频率(但也会加大每次GC的停顿时间),主要是看老生代里没多少长期对象的话,占2/3太多了。可以用-Xmn 直接赋值(等于-XX:NewSize and -XX:MaxNewSize同值的缩写),或把NewRatio设为1来对半分(但如果想设置新生代比老生代大就只能用-Xmn)
2018-10-18T03:27:39.204+0800: 33729.026: Total time for which application threads were stopped: 0.0059280 seconds, Stopping threads took: 0.0001000 seconds
There’s a JVM option -XX:+AggressiveOpts that supposedly makes your JVM faster. Lots of people turn this on in Eclipse to try to make it faster. But it makes your JVM less correct. Today I found it to be the cause of a longstanding bug in dx. http://code.google.com/p/android/issues/detail?id=5817
-XX:+AggressiveOpts was deprecated in JDK 11 and should be removed in JDK 12
zooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services
/** * 计数排序 * @param array */ public static void countSort(int []array){ //最大最小数 int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for ( int a:array) { if(min > a) { min = a; } if(max < a) { max = a; } }
//数组索引数量,统计数组计数 // max-min 主要是考虑到像[90,99,93,95]不是从很小数开始的数组排序,减小空间消耗 int indexCount = max - min + 1; System.err.println("统计数组长度"+indexCount); int []countArray = new int[indexCount];
for (int i=0;i<array.length;i++){ System.err.println(array[i]-min); countArray[array[i]-min]++; } System.err.println("countArray:"+Arrays.toString(countArray));
//排好序的数组 int [] sortArray = new int[array.length]; int index = 0; for (int i=0;i<indexCount;i++) { for (int j=0;j<countArray[i];j++){ sortArray[index++] = min + i; } } //输出就是有序 System.err.println(Arrays.toString(sortArray)); }
/** * 稳定计数排序 * @param array */ public static void countSort1(int []array) { //最大最小数 int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; for ( int a:array) { if(min > a) { min = a; } if(max < a) { max = a; } }
//数组索引数量,统计数组计数 // max-min 主要是考虑到像[90,99,93,95]不是从很小数开始的数组排序,减小空间消耗 int indexCount = max - min + 1; System.err.println("统计数组长度"+indexCount); int []countArray = new int[indexCount];
for (int i=0;i<array.length;i++){ System.err.println(array[i]-min); countArray[array[i]-min]++; } System.err.println("countArray:"+Arrays.toString(countArray)); //位置数组 int []pointArray = new int[indexCount];
int sum =0; for (int i = 0;i<indexCount;i++){ sum += countArray[i]; pointArray[i] = sum; } System.err.println("pointArray:"+Arrays.toString(pointArray)); System.err.println("aaaaaArray:"+Arrays.toString(array)); //排好序的数组 int [] sortArray = new int[array.length]; for (int i=array.length-1;i>=0;i--) { sortArray[pointArray[array[i]-min] -1 ] = array[i]; pointArray[array[i]-min]--; } //输出就是有序 System.err.println(Arrays.toString(sortArray)); }