title: How can I approximate the size of a data structure in scala?
body: <p>I have a query that returns me around 6 million rows, which is too big to process all at once in memory.</p>
  
  <p>Each query is returning a Tuple3[String, Int, java.sql.Timestamp]. I know the string is never more than about 20 characters, UTF8.</p>
  
  <p>How can I work out the max size of one of these tuples, and more generally, how can I approximate the size of a scala data-structure like this?</p>
  
  <p>I've got 6Gb on the machine I'm using. However, the data is being read from the database using scala-query into scala's Lists.</p>