I'm trying to find the size of my case class object inside scala project using sizeEstimator but it is giving unexpected results.
import org.apache.spark.util.SizeEstimator
case class event(imei: String, date: String)
val check = event(imei, date)
println("size is event obj " + SizeEstimator.estimate(check))
println("size is single charct " + SizeEstimator.estimate("a"))
println("size is imei " + SizeEstimator.estimate(imei))
It gives output as
size is event obj 520
size is single 48
size is imei 72
Why is this taking insane size ? for a single character "a" it should be 1 byte and my imei is 15 character string value to it also should be 15 byte. Any suggestions please. Thanks,