学习是最好的投资!
You can simplify spring:
//简化成下面这样,具体可以去看spring源码 Map<String, Object> applicationContext
In the default Singleton mode, after loading the xml, the instantiated object has been referenced by the ApplicationContext and will not be recycled during the spring life cycle
Initialized beans are maintained in a map, and this map is final修饰,这样map就作为了一个GC ROOT对象,jvm采用的可达性分析算法
final
GC ROOT
jvm
可达性分析算法
You can simplify spring:
In the default Singleton mode, after loading the xml, the instantiated object has been referenced by the ApplicationContext and will not be recycled during the spring life cycle
Initialized beans are maintained in a map, and this map is
final
修饰,这样map就作为了一个GC ROOT
对象,jvm
采用的可达性分析算法