sizeOfObject

Best effort attempt to estimate the size in bytes of an undetermined object. Known types will be estimated according to their formulas, and all other object sizes will be estimated as .UNKNOWN_DEFAULT_RAM_BYTES_USED.


fun sizeOfObject(o: Any?, defSize: Long): Long

Best effort attempt to estimate the size in bytes of an undetermined object. Known types will be estimated according to their formulas, and all other object sizes will be estimated using .shallowSizeOf, or using the supplied defSize parameter if its value is greater than 0.