Hello, I have a hibernate application with a huge object graph (over 2000 tables with over 20 columns per table). As known, this will lead to huge memory usage during startup. So I walked over the known tips; configuring the Query plan cache, the default_batch_fetch_size, the batch_fetch_style, and all the stuff.
Now, some of my EntityLoaders (within the same singleTableEntityPersister), have exactly the same generated SQL (exactly character by character), so I was looking if Hibernate offers a way to share these Strings (SQL) between EntityLoaders without success.
So I used the GC1 StringDeduplication but without gaining too much. The reason seems to be that even if Sql(s) are the same (visually) they do not have the same byte array, and the GC1 won't be able to deduplicate the String and memory still occupied. Can It be related to Encoding when hibernate create the SQl String? No idea. Maybe I'm missing something .
PS: I know that there was a big improvement beginning from version 5.2.18 but I created this ticket maybe the same behavior still exists. |
|