title: Case classes memory consumption
body: <p>I have the code that defines some entity structure, for example:</p>
  
  <pre><code>case class EntityDefinition(id: UUID,
                              name: String,
                              propertyDefinitions: Map[String, PropertyDefinition] = Map.empty[String, PropertyDefinition])
  </code></pre>
  
  <p>And i have the following code for entity:</p>
  
  <pre><code>case class Entity(entityDefinition: EntityDefinition, 
                    id: UUID, key: String, 
                    properties: Map[String, Property[Any]])
  </code></pre>
  
  <p>Will each entity take extra memory for storing it's entityDefinition instance? I intend to keep the number of EntityDefinitions very low, but each will occupy significant size.</p>
  
  <p>So the question is whether to keep this structure for an entity, or to implement some kind of Reference that would get the entity definition from the cache on demand?</p>