Github user franz1981 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1505
  
    @clebertsuconic In the meantime I've done some experiments with [Java 
Object Layout](http://openjdk.java.net/projects/code-tools/jol/), a tool that 
compute the deep size of any instance on the heap, to evaluate the difference 
(memory wise) between `LinkedListImpl` and `ChunkedQueue`.
    I've used a very small chunk size of 32 (ie with arrays of 33 elements for 
each chunk), to compare with `LinkedListImpl`.
    With no instances:
    ```
    org.apache.activemq.artemis.utils.collections.LinkedListImpl@7ba4f24fd 
footprint:
         COUNT       AVG       SUM   DESCRIPTION
             1        56        56   
[Lorg.apache.activemq.artemis.utils.collections.LinkedListImpl$Iterator;
             1        40        40   
org.apache.activemq.artemis.utils.collections.LinkedListImpl
             1        32        32   
org.apache.activemq.artemis.utils.collections.LinkedListImpl$Node
             3                 128   (total)
    
    
    org.apache.activemq.load.generator.ChunkedQueue@6ed3ef1d footprint:
         COUNT       AVG       SUM   DESCRIPTION
             1       152       152   [Ljava.lang.Object;
             1        40        40   
org.apache.activemq.load.generator.ChunkedQueue
             2                 192   (total)
    ```
    With 31 instances:
    ```
    org.apache.activemq.artemis.utils.collections.LinkedListImpl@7ba4f24fd 
footprint:
         COUNT       AVG       SUM   DESCRIPTION
             1        56        56   
[Lorg.apache.activemq.artemis.utils.collections.LinkedListImpl$Iterator;
             1        24        24   java.lang.Long
             1        40        40   
org.apache.activemq.artemis.utils.collections.LinkedListImpl
            32        32      1024   
org.apache.activemq.artemis.utils.collections.LinkedListImpl$Node
            35                1144   (total)
    
    
    org.apache.activemq.load.generator.ChunkedQueue@57fa26b7d footprint:
         COUNT       AVG       SUM   DESCRIPTION
             1       152       152   [Ljava.lang.Object;
             1        24        24   java.lang.Long
             1        40        40   
org.apache.activemq.load.generator.ChunkedQueue
             3                 216   (total)
    ```
    With 10000 instance:
    ```
    org.apache.activemq.artemis.utils.collections.LinkedListImpl@7ba4f24fd 
footprint:
         COUNT       AVG       SUM   DESCRIPTION
             1        56        56   
[Lorg.apache.activemq.artemis.utils.collections.LinkedListImpl$Iterator;
             1        24        24   java.lang.Long
             1        40        40   
org.apache.activemq.artemis.utils.collections.LinkedListImpl
         10001        32    320032   
org.apache.activemq.artemis.utils.collections.LinkedListImpl$Node
         10004              320152   (total)
    
    
    org.apache.activemq.load.generator.ChunkedQueue@1894593ad footprint:
         COUNT       AVG       SUM   DESCRIPTION
           323       152     49096   [Ljava.lang.Object;
             1        24        24   java.lang.Long
             1        16        16   java.lang.Object
             1        40        40   
org.apache.activemq.load.generator.ChunkedQueue
           326               49176   (total)
    ```
    Totals are pretty explicative, the `ChunkedQueue` (even with very small 
chunk size) tends to have a 10X smaller memory footprint than a 
`LinkedListImpl`.
    
    
    



---

Reply via email to