[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5927) Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan

Strong Liu (JIRA) noreply at atlassian.com
Tue Feb 28 11:52:51 EST 2012


    [ https://hibernate.onjira.com/browse/HHH-5927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45731#comment-45731 ] 

Strong Liu commented on HHH-5927:
---------------------------------

https://github.com/hibernate/hibernate-orm/pull/283

    1. remove commons-collections dependency.
    2. moved org.hibernate.internal.util.collections.ConcurrentReferenceHashMap 
    3. Using ConcurrentReferenceHashMap this to replace old ReferenceMap (from c
    4. copied org.hibernate.internal.util.collections.BoundedConcurrentHashMap f
    5. deprecate properties QUERY_PLAN_CACHE_MAX_STRONG_REFERENCES and QUERY_PLA
    6. add two new properties QUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZE and Q
    7. remove LRUMap, SimpleMRUCache and SoftLimitMRUCache

> Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5927
>                 URL: https://hibernate.onjira.com/browse/HHH-5927
>             Project: Hibernate ORM
>          Issue Type: Improvement
>          Components: core
>            Reporter: Strong Liu
>            Assignee: Strong Liu
>         Attachments: hotspot.png
>
>
> with Order Demo (real-life simulation attempt test app) I have noticed that there is thread contention on createNamesQuery() which sounds suspicious.
> After investigation it boils down to org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan. It serves as a cache (internal, not replacable) for queries using LRU algorithm (supplied from Apache utils).
> Generally speaking, blocking threads in any sort of caches indicates a problem. From about 2000 calls, 700 got blocked (which is also not nice for context switching).
> I guess, one of the problems is that there is exclusive synchronization in get method:
> public synchronized Object get(Object key) {...}
> which could be replaced by a more granular read-write lock.
> org/hibernate/engine/query/QueryPlanCache.java
> org/hibernate/util/SoftLimitMRUCache.java

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list