String字符串性能优化的几种方案(14)


未使用intern的GC日志:

不用intern:354[GC (System.gc()) [PSYoungGen: 377487K->760K(2752512K)
377487K->768K(2758656K) 0.0009102 secs
[Times: user=0.00 sys=0.00 real=0.00 secs
[Full GC (System.gc()) [PSYoungGen: 760K->0K(2752512K)
[ParOldGen: 8K->636K(6144K)
768K->636K(2758656K) [Metaspace: 3278K->3278K(1056768K)
0.0051214 secs
[Times: user=0.00 sys=0.00 real=0.00 secs
HeapPSYoungGen      total 2752512K used 23593K [0x0000000700000000 0x00000007c0000000 0x00000007c0000000)eden space 2359296K 1% used [0x00000007000000000x000000070170a5480x0000000790000000)from space 393216K 0% used [0x00000007900000000x00000007900000000x00000007a8000000)to   space 393216K 0% used [0x00000007a80000000x00000007a80000000x00000007c0000000)ParOldGen       total 6144K used 636K [0x0000000640000000 0x0000000640600000 0x0000000700000000)object space 6144K 10% used [0x00000006400000000x000000064009f2f80x0000000640600000)Metaspace       used 3284K capacity 4500K committed 4864K reserved 1056768Kclass space    used 359K capacity 388K committed 512K reserved 1048576K

推荐阅读