[jboss-jira] [JBoss JIRA] (JGRP-2127) UnicastHeader3: reduce in-memory size

Bela Ban (JIRA) issues at jboss.org
Wed Nov 9 07:35:00 EST 2016


Bela Ban created JGRP-2127:
------------------------------

             Summary: UnicastHeader3: reduce in-memory size
                 Key: JGRP-2127
                 URL: https://issues.jboss.org/browse/JGRP-2127
             Project: JGroups
          Issue Type: Enhancement
            Reporter: Bela Ban
            Assignee: Bela Ban
            Priority: Minor
             Fix For: 4.0


JOL reports:
{noformat}
org.jgroups.protocols.UnicastHeader3 object internals:
 OFFSET  SIZE    TYPE DESCRIPTION                    VALUE
      0     4         (object header)                01 00 00 00 (00000001 00000000 00000000 00000000) (1)
      4     4         (object header)                00 00 00 00 (00000000 00000000 00000000 00000000) (0)
      8     4         (object header)                9d 11 01 f8 (10011101 00010001 00000001 11111000) (-134147683)
     12     2   short Header.prot_id                 0
     14     2         (alignment/padding gap)        N/A
     16     8    long UnicastHeader3.seqno           0
     24     8    long UnicastHeader3.timestamp       0
     32     2   short UnicastHeader3.conn_id         0
     34     1    byte UnicastHeader3.type            0
     35     1 boolean UnicastHeader3.first           false
     36     4         (loss due to the next object alignment)
Instance size: 40 bytes
Space losses: 2 bytes internal + 4 bytes external = 6 bytes total
{noformat}

We could reduce the size to 32 by making {{timestamp}} an int. This field is used for comparison against previous timestamps, and since the comparison takes numeric overflow into account, wrap-around is not a problem.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list