VM 增加 -XX:StringTableSize=20000 -XX:+PrintStringTableStatistics
输出
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
cost:20 SymbolTable statistics: Number of buckets :20011=160088bytes,avg8.000 Number of entries :18968=455232bytes,avg24.000 Number of literals :18968=717080bytes,avg37.805 Total footprint :=1332400bytes Average bucket size :0.948 Variance of bucket size :0.944 Std. dev. of bucket size:0.971 Maximum bucket size :7 StringTable statistics: Number of buckets :20000=160000bytes,avg8.000 Number of entries :2069=49656bytes,avg24.000 Number of literals :2069=135320bytes,avg65.404 Total footprint :=344976bytes Average bucket size :0.103 Variance of bucket size :0.103 Std. dev. of bucket size:0.321 Maximum bucket size :4