一次内存优化Double-》double

 1

 

 

2 发现对方缓存了Double,

readfile

getDouble

put in intern map

set Double to object.double

no one is using Double expect that map

 

2.1 使用弱引用或虚引用证明

load 2 collection, print top 100 Double and hashcode

run the new job to print the weak reference to those Double, validate if same hashcode with step 1

delete both collection, gc

run the new job again, found collectiuon 1 Double null, but collection 2 Double non-null

clear the intern map, gc

run the new job again, now collection 2 Double null

posted on 2024-08-21 23:09  silyvin  阅读(1)  评论(0编辑  收藏  举报