title: BitSet memory usage in Scala
body: <p>I would like to know what is the memory usage of BitSet in Scala.For example, if I do:</p>
  
  <pre><code>  var bitArray:BitSet=new BitSet(10)
    bitArray.add(0)
    bitArray.add(2)
    bitArray.add(4)
    bitArray.add(6)
    bitArray.add(8)
  </code></pre>
  
  <p>How does that compare with and array containing the even numbers 0,2,4,6,8?</p>
  
  <p>What about writing a number in binary:</p>
  
  <pre><code>  var bitArray:BitSet=new BitSet(32)
    bitArray.add(5)
    bitArray.add(3)
    bitArray.add(2)
    bitArray.add(1)
    bitArray.add(0)
  </code></pre>
  
  <p>How does that compare to the number 47?</p>
  
  <p>I'm asking here of memory usage. But as a more open question, if you know, what are the advantages/disadvantages or uses of BitSet (WR to other common data types).</p>
  
  <p>Thanks,</p>