Approximate calculation for custom object overhead on heap will look like:
entries = N
fields number = flds
header size = 24
fields id size = 4
BinaryObjectImpl = 40
byte arr header 16 + len 4 = 20 (at least, omitted padding)

N*(24 + flds*4 + 40 + 20) = 4*N*(21 + flds),

so for one entry with one field you'll get ~88 bytes overhead. But take in
account that this value is for user custom object, for primitives or
collections it will be much smaller.

Also, in CSV data stored as a strings, and the same value may take different
amount of memory:
"1" in CSV is 1 byte, when integer in memory takes 4 bytes and
"1234567" in CSV is 7 bytes, when in memory is still 4 bytes.

NOTE. Do not reference on that calculations as precise, because there a lot
of other objects and links associated with entry, result depends on actual
entry size, no optimizations are taken into account, for 32 bit system
values will differ, etc.

BinaryObjectImpl may hold deserialized value to cache and decrease number of
deserializations, and always holds serialized (byte array).



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Memory-consumption-in-apache-ignite-tp9035p9109.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to