When you place everything in your session, you are using more memory. A session usually ends after 35 minutes or by default.
Viewscoped beans are free to collect garbage after switching views.
For small objects this is probably not a big deal in small applications. However, if you, for example, store return values ββfrom the database in your session, you will have to take care of the memory used.
source share