You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> case class Person(name: String, surname: String)
defined class Person
scala> objectexplorer.MemoryMeasurer.measureBytes(Person("", ""))
res1: Long = 64
scala> objectexplorer.MemoryMeasurer.measureBytes(Person("h", ""))
res2: Long = 112
scala> objectexplorer.MemoryMeasurer.measureBytes(Person("h", "h"))
res3: Long = 72
In the first line I declare a class with two properties. In the second I measure the size of an object of that class that is instantiated with 2 empty strings. In the third, an object with 1 character string and empty string. The size is indeed larger. Now I try with an object of two such strings. The size becomes less?
The text was updated successfully, but these errors were encountered:
(sorry the example is in Scala)
In the first line I declare a class with two properties. In the second I measure the size of an object of that class that is instantiated with 2 empty strings. In the third, an object with 1 character string and empty string. The size is indeed larger. Now I try with an object of two such strings. The size becomes less?
The text was updated successfully, but these errors were encountered: