|
org.hibernate.cfg.Configuration object size depends on individual configuration. The configuration is used for session factory creation, then can be garbage collected during gc.
When setting the session factory observer, anonymous class is created (SessionFactoryObserver). This class has implicit reference to the outer class: org.hibernate.cfg.Configuration. Since the created observer object lives as long as session factory, the configuration object will never garbage collected.
|