Issue
Consider that I'm not using the Production Server for a week. What will happen to the Spring Beans that are created? Do they stay in the memory ? or Do they have a idle timeout to call its destroy and close the application context till the next request?
Solution
Spring beans are created at application startup and will stay in memory, until the application is stopped. The same is true for the application context that contains all these beans, it will also stay in memory. If the application context would be closed, there would be nothing to process the next request.
As Alex.R commented, beans may have other scopes like 'request' or 'session', but that is a different story.
Considering it as Singleton, after 1 week too the beans stays in memory right ? Exactly. Spring does not destroy singleton beans on its own.
I was running some demo spring apps on Amazon, which sometimes had no traffic for month and they never shut down from alone.
Answered By - Stefan Isele - prefabware.com