This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

problems with singleton beans in spring

Jan 9th, 2012, 01:57 AM

Hi There,

I am developing a web application. Since spring beans are singleton in default i cannot use that scope for my pojo's.
I have to mark my bean as request / prototype. I thought of going with request scope.
I want to know if bean is marked as request and after request ends then is that object destroyed by application/ or object is marked for gc or if in case there is going to be out of memory error then this objects will be garbage collected just before jvm cries for out of space error/ nothing happens and object are left hanging waiting for jvm to take suitable action.