Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/2012
@cshannon
Summarized:
```
org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl:
Instance size: 72 bytes
Space losses: 2 bytes internal + 4 bytes external = 6 bytes total
org.apache.activemq.artemis.core.paging.cursor.PagedReferenceImpl:
Instance size: 104 bytes
Space losses: 1 bytes internal + 4 bytes external = 5 bytes total
org.apache.activemq.artemis.core.server.impl.LastValueQueue$HolderReference:
Instance size: 40 bytes
Space losses: 3 bytes internal + 0 bytes external = 3 bytes total
```
`Instance size` is the value you're searching for: I have attached the
`Space losses` as well, because it
is related to what @michaelandrepearce is saying: just adding that mere 4
bytes reference (with heap < 32 Gb the JVM uses compressed oops by default) has
added 4 bytes (external) of padding ie a total of 8 bytes of more space used.
TBH that's a difficult choice: we have done recently many changes to make
every protocol much GC "gentle" to allow scaling more easily, but @cshannon is
right that there are monitoring/telemetry reasons very important to be achieved
as well.
You both have very good points :O
---