title: Are data.tables stored twice in ReferenceClass objects?
body: <p>I do not know if this is just an odd behavior of <code>data.table::tables()</code> or if this is maybe a problem:</p>
  
  <pre><code>library(data.table)
  TestClass &lt;- setRefClass(  
    Class  = "TestClass",  
    fields = list(
      dt = "data.table"
    ),
    methods = list(
      setTable = function( rows ){
        dt &lt;&lt;- data.table( a = seq_len(rows), b = seq_len(rows) )
      }
    )
  )
  
  tc &lt;- TestClass$new()
  tc$setTable( rows = 1E7 )
  </code></pre>
  
  <p>When I look at the memory consumption, I'll get</p>
  
  <pre><code>tables( env=tc )
       NAME        NROW MB COLS KEY
  [1,] .-&gt;dt 10,000,000 77 a,b     
  [2,] dt    10,000,000 77 a,b     
  Total: 154MB
  </code></pre>
  
  <p>Does this mean, that the <code>data.table</code> really consumes twice the amount of memory than necessary?</p>