By default when the application starts, all beans are initialized @Component, etc.
Spring will create an instance of it and make it available
Instead of creating all beans upfront, we can specify lazy initialization.
A bean will be initialized in the following case
It is needed dependency injection
or it is explicitly requested.
add @Lazy to the given class
![](https://onlinestudy.guru/wp-content/uploads/2024/05/image-10-1024x503.png)
![](https://onlinestudy.guru/wp-content/uploads/2024/05/image-11-1024x491.png)