Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:02:50+00:00 2026-06-12T08:02:50+00:00

I have an application with about 3000 entity classes. Due to the large number

  • 0

I have an application with about 3000 entity classes.

Due to the large number of classes the SessionFactory object consumes about 150 MB of memory and takes almost a minute to setup (process all classes, generate the proxies and building the meta model).
After profiling the process I’ve discovered that a minute of the time is spent in org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory while half is in org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(EntityMetamodel, PersistentClass).
I’m looking for ways to reduce the SessionFactory memory usage and load time.
One thought was to move the class enhancement to compile time, but I didn’t find much information about it.
The number of entities is a fact that I can’t change but if someone has better ideas on how to handle their database access (other than Hibernate) I’ll be happy to hear about it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:02:51+00:00Added an answer on June 12, 2026 at 8:02 am

    Start by looking at what’s happening inside the SessionFactory. Hibernate offers a JMX connector, see documentation here. Then you can start to look into your hotspots and how to refactor them. You really need to begin with gathering some more metrics. Right now it could be anything, including GC problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an application I will have between about 3000 and 30000 strings. After creation
I have read about application object in android site but I couldn't understand. What
I have setup an application to parse about 3000 files a day where each
We are still in .NET 1.1 I have a small application about 15 pages.
We have a application of size about 20MB in release mode. This application is
I have a rails application that about 3 years old, and I'm having a
We have an application which has about 15000 pages. For better SEO reasons we
I wrote an application about NFC in android,but I have a problem. When I
I have a server-client application [TCP sockets, .NET 4.0].. the application about : do
I have an iphone application which has about 4 tabs. How do I force

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.