| Finding that the use of @Fetch(FetchMode.SUBSELECT) results in a significant level of string duplication for SQL and SQL fragments. When loading large datasets and/or higher numbers of associations with multiple associations using SUBSELECT the memory can accumulate significantly (e.g. on the order of multiple GB for string space associated with the duplicate SQL fragments alone). The testcase has a rather small set of strings for only 600 simple entities. The strings seem to be retained in a hierarchy like the below:
An OQL query (in Eclipse MAT) like the below was used to obtain the strings/fragments related to queries when running in the debugger with a breakpoint at commit (e.g. in the attached test).
|