Details
-
Improvement
-
Status: Resolved
-
Medium
-
Resolution: Done
-
None
-
None
-
None
Description
Heap dump analysis from CONTROLLER-1898 shows that a typical openflow-related workload does not use more than one predicates anywhere – every one of the 1.4M objects has exactly one predicate.
This translates to 1.4M SharedSingletonMap instances, each costing a 24 bytes of storage – for a total of 34MiB, i.e. 3.7% of total memory footprint.
Current layout of NodeIdentifierWithPredicates results in 32/40 bytes per instance, with 7 bytes being wasted on alignment – hence we could inline the single key/value eliminating the need for retained secondary objects.
While straightforward, this will result in a Map, which will not retain a cached hashCode, hence is subject to trade-offs and further design.
Irrespective of that, we need to turn this class into a non-final value-based object, i.e. eliminate all of its public constructors, so that users are no longer strongly connected to its design.