[infinispan-issues] [JBoss JIRA] (ISPN-5308) Reduce ConcurrentHashMapv8 allocations

William Burns (JIRA) issues at jboss.org
Tue Mar 17 10:14:18 EDT 2015


William Burns created ISPN-5308:
-----------------------------------

             Summary: Reduce ConcurrentHashMapv8 allocations
                 Key: ISPN-5308
                 URL: https://issues.jboss.org/browse/ISPN-5308
             Project: Infinispan
          Issue Type: Enhancement
          Components: Eviction
    Affects Versions: 7.2.0.Beta1
            Reporter: William Burns
            Assignee: William Burns


The current EquivalentConcurrentHashMapv8 allocates a lot of extra entries for the sake of atomicity.  It would be helpful to reduce these allocations if possible.

# Whenever a get refreshes an entries recency we have to allocate a new DequeNode.  This is because of ConcurrentLinkedDeque not always removing the node (this can happen when the node is a head or tail node.  If we are able to detect when the node was removed and reuse it it will drastically reduce how many allocations this uses since a deque should rarely be removed from the head or tail on a get.
# The current size and current number of evicting elements is stored as 2 longs in a custom class.  We have to use compare and set semantics to keep these correct.  If instead we utilized a single long where the top 16 bits are reserved for number of evicting elements (concurrent puts) and used the bottom 48 bits for the actual size we can use a simple AtomicLong instead.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the infinispan-issues mailing list