[jira] [Created] (IGNITE-2577) Investigate HashMap.Node[] allocations from GridDistributedTxMapping.add()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-2577) Investigate HashMap.Node[] allocations from GridDistributedTxMapping.add()

Anton Vinogradov (Jira)
Vladimir Ozerov created IGNITE-2577:
---------------------------------------

             Summary: Investigate HashMap.Node[] allocations from GridDistributedTxMapping.add()
                 Key: IGNITE-2577
                 URL: https://issues.apache.org/jira/browse/IGNITE-2577
             Project: Ignite
          Issue Type: Task
          Components: cache
    Affects Versions: 1.5.0.final
            Reporter: Vladimir Ozerov
             Fix For: 1.6


*Problem*
GridDistributedTxMapping is initialized with empty HashSet() for TX entries by default.
When the very first element is added, undelying HashMap expands causing memory traffic.

*Proposed solutions*
1) Use LinkedList instead. One can notice that when GridDistributedTxMapping is deserialized using direct reader, "entries" are read as list. Furthermore, both "reads" and "writes" projections are returned as wrapped views, so that do not benefit form fast lookups.
If we neither perform lookups from entries, nor require "unique" Set semantics, "entries" could be changed to LinkedList thus decresaing memory traffic.
2) Use special singleton collection. This way we will have to evaluate all "entries" usages very carefully.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)