java - 面试题:Spring容器启动的时候会加载Bean,那么这些Bean会被加载到什么地方?
PHP中文网
PHP中文网 2017-04-18 09:40:17
0
2
334

如题:面试题:Spring容器启动的时候会加载Bean,那么这些Bean会被加载到什么地方?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
洪涛

It will be loaded into the JVM memory heap, managed by beanFactory, and the started one may not be loaded...

--If the Bean is a singleton, it will be loaded at startup by default. If lazy initialization is set,
--or multiple instances will be loaded as needed (the object is referenced)...

================================

And it should be noted that if the object is obtained through multiple instances, in spring, it controls its memory releasethrough reference counting,
so when using multiple instances of beans, remember to add references Set null
For example:
Bean b = new Bean();

//When not in use
b = null;

迷茫

They are all placed in BeanFactory

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!