0

I have a custom object which I am converting to BinaryObject (using BinaryObjectBuilder) before putting it into ignite cache.

The deep size of my custom object is about 500 bytes, the size of the BinaryObject is a whopping ~8 MB and the size of data that is actually sent to Ignite server is ~300 bytes.

As BinaryObject is how Ignite stores data internally, what are the pros and cons of creating BinaryObject in the client and sending it the sever vs sending a pojo and letting the server internally convert it to BinaryObject? The drawback of creating BinaryObject in the client is that I am using ~8.5MB of RAM to store ONE BinaryObject in the client jvm heap which is going to be much smaller than the server jvm heap.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
CaptainHastings
  • 1,557
  • 1
  • 15
  • 32
  • How did you measure the object size? What if you create 10 such objects, will they consume 80 MB? – maaartinus Apr 15 '18 at 22:40
  • I used JOL to measure the object size. Correct, each of my object which are about 500 bytes turned into a ~8MB object, So 10 would consume 80MB. – CaptainHastings Apr 16 '18 at 00:45
  • JOL = http://openjdk.java.net/projects/code-tools/jol/ – CaptainHastings Apr 16 '18 at 00:45
  • I'd expect the 8 MB to be some shared data. Otherwise it just makes no sense. There're surely quite some metadata or pre-allocated memory there (but even then it's too much). I'd distrust JOL here and measure the consumed heap when many objects get created. Another possibility would be that the sharing is prevented by how you created the objects. You really should post some code and the JOL output. Try to simplify the problem by using a simpler object, so you can find the culprit. No sane tool explodes all objects by a factor of 16000 - this would render it totally unusable. – maaartinus Apr 16 '18 at 03:39

1 Answers1

1

This is a duplicate of Apache Ignite BinaryObject Bloat

Objects don't become 8 MB in size, when you convert them to BinaryObjects. Each BinaryObject stores links to some shared data, which is the same for each object. And this data is not sent over network.

Try analysing your heap dump, using a tool, that can build a dominators tree. You will see, that retained size of your BinaryObject is around 300 bytes, and not 8 megabytes.

Denis
  • 3,573
  • 8
  • 13