BitSet memory usage in Scala
问题 I would like to know what is the memory usage of BitSet in Scala.For example, if I do: var bitArray:BitSet=new BitSet(10) bitArray.add(0) bitArray.add(2) bitArray.add(4) bitArray.add(6) bitArray.add(8) How does that compare with and array containing the even numbers 0,2,4,6,8? What about writing a number in binary: var bitArray:BitSet=new BitSet(32) bitArray.add(5) bitArray.add(3) bitArray.add(2) bitArray.add(1) bitArray.add(0) How does that compare to the number 47? I'm asking here of memory