seniorSpring
How does Spring handle lazy initialization of beans?
Updated May 17, 2026
Short answer
Lazy initialization delays bean creation until it is first used.
Deep explanation
By default, singleton beans are eagerly initialized at startup. Using @Lazy defers instantiation, reducing startup time but shifting cost to first request. It can also help break circular dependencies.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro