Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Classes with @MappedSuperclass use a lot of memory
Classes with @MappedSuperclass use a lot of memory [message #1824482] Wed, 15 April 2020 23:50 Go to next message
Eclipse UserFriend
I defined all base entity classes, which are abstract and annotated with @MappedSuperclass, in a seperaSte jar. There about 400 entities.
Then my services can import this jar, and inhere the base entity classes if it needs.

But when I ran one service, I found that service requires an additional 600MB memory after startup than without this jar. Even if the service doesn't use any base entity.

Service uses spring boot 1.5.13.RELEASE and eclipselink 2.7.6.
The eclipselink.weaving is static.

Why those abstract classes use so many memory? Is there a switch to disable it? Or is there any workaround?

Thanks for the help.
Re: Classes with @MappedSuperclass use a lot of memory [message #1826174 is a reply to message #1824482] Mon, 20 April 2020 11:42 Go to previous message
Eclipse UserFriend
As for the 600MB extra memory - it would entirely depend on what is in there, to which you've not provided any insights, such as how many persistence units this is used in, how much memory was required before this base jar was added etc. Doesn't sound like a bug though, and until you know what/where the cause is, no one can suggest workarounds or switches to disable memory consumption. Could be you defined a million named queries on one of those base classes - who but you can say?

I'm not sure what you mean "even if the service doesn't use any base entity", but everything referenced from a persistence unit must be loaded when the persistence unit is loaded. Everything must be traversed looking for annotations etc that build metadata for every entity within the persistence unit, and this happens upon deployment. If this is a concern, you should be using smaller, compartmentalized persistence units, to prevent having to load unnecessary classes and mapping data.

Previous Topic:how to Use UNION and Order by Clause in my JPQL Query
Next Topic:Embeddable constants incorrectly initialize to the same value
Goto Forum:
  


Current Time: Sat Jul 12 11:50:56 EDT 2025

Powered by FUDForum. Page generated in 0.09383 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top