Thorsten Goetzke (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6422e66...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjEzZDZkYzk4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16440?atlOrigin=eyJpIjoiZjEzZD...
) HHH-16440 (
https://hibernate.atlassian.net/browse/HHH-16440?atlOrigin=eyJpIjoiZjEzZD...
) Classleak in the BytecodeProviderImpl (
https://hibernate.atlassian.net/browse/HHH-16440?atlOrigin=eyJpIjoiZjEzZD...
)
Issue Type: Bug Assignee: Unassigned Attachments: Fun2Test.java, FunTest.java,
grafik-20230405-141332.png Created: 05/Apr/2023 07:16 AM Priority: Major Reporter:
Thorsten Goetzke (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6422e66...
)
The classes generated by the ByteBuddyProvider can only be unloaded if the classloader
will become unreachable. If you dont use a dynamic Classloader the classes cannot be
thrown away and will stay in memory permanently.
The problem we run into especcially in testing is that the memory runs full with classes
generated by the ByteCodeProvider.
This can somwhat be worked around by overriding #resetCaches to not actually
resetCaches-> clearing the Caches is good if you use a deployment classloader, but if
you dont have a deployment classloader it is actively bad for you…
However that still leaves a few issues:
#getReflectionOptmizer creates a “fastClass”. this class is currently not cached, but it
should be.
It seems not optimal to me to create the “fastClass” before actually checking the
acessors-> if there is a problem with the acessors it ends up loading a new class in
the jvm with no befits at all.
I attached 2 semi automatic testcases:
Excpected: resources needed stay the same, regardless if ReflectionOptimization is uses or
not .
Actual: more and more classes are added to the jvm
(
https://hibernate.atlassian.net/browse/HHH-16440#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16440#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100221- sha1:78e8bd6 )