aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EntityManagerFactory init creates excessive objects? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EntityManagerFactory init creates excessive objects?" Watch "EntityManagerFactory init creates excessive objects?" New topic
Author

EntityManagerFactory init creates excessive objects?

Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114
hi,

I am profiling my java web app with YourKit to reduce memory usage and I have found out that one of the biggest memory occupants is created by javax.persistence.Persistence.createEntityManagerFactory

Have a look at memory allociations tree:

Name, Recorded Objects, Size
javax.persistence.Persistence.createEntityManagerFactory(String) 390292 160876904

going into lower levels, I can see this:

org.hibernate.util.ReflectHelper.classForName(String) 60165 124122640

and it's 2 subnodes:

java.lang.ClassLoader.loadClass(String) 33334 37485640
java.lang.Class.forName(String) 26831 86637000

is this correct behaviour?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: EntityManagerFactory init creates excessive objects?