Skip to content

Commit 991ff26

Browse files
stuartwdouglassebersole
authored andcommitted
HHH-10279 - Memory usage improvements -
* Don't allocate IdentityMap if it is not needed * Only allocate unresolved insertions if requied * Don't create a new string when creating a named query * Allocate querySpaces lazily * Remove executableLists from ActionQueue * Allocate ExecutableList instances lazily * Lazily allocate the transaction commit task lists * Don't allocate a new EntityKey
1 parent fa78510 commit 991ff26

File tree

5 files changed

+281
-121
lines changed

5 files changed

+281
-121
lines changed

hibernate-core/src/main/java/org/hibernate/engine/query/spi/HQLQueryPlan.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ public List performList(
213213

214214
final int guessedResultSize = guessResultSize( rowSelection );
215215
final List combinedResults = new ArrayList( guessedResultSize );
216-
final IdentitySet distinction = new IdentitySet( guessedResultSize );
216+
final IdentitySet distinction;
217+
if ( needsLimit ) {
218+
distinction = new IdentitySet(guessedResultSize);
219+
} else {
220+
distinction = null;
221+
}
217222
int includedCount = -1;
218223
translator_loop:
219224
for ( QueryTranslator translator : translators ) {

0 commit comments

Comments
 (0)