We are trying to improve performance in our Java application. While using the Memory Analysis tool, I noticed that there are many duplicate Strings that seem to have originated in Hibernate. For example, the Memory Analysis Tool sees over 6000 occurrences of "rowid_0_" and "0_", and tracing to the GC root shows Hibernate's involvement:

It seems as though we could improve performance if we could intern those Strings. If it were "our" code, I could modify it and see the effects. Is there any way that I can coerce Hibernate into using interned Strings?
new String()inorg.hibernate.loader.DefaultEntityAliases. If anything it does intern strings. grepcode.com/file/repository.springsource.com/org.hibernate/…StringBuilderdoes indeed create a new String.