Hi 

I was writing a sample program to use IgniteDataStreamer and was looking at
the objects which are created   while we use the addData method of the
Streamer. Here is the sample code (pasting only relevant code).

try (IgniteDataStreamer<Integer, Integer> streamer =
ignite.dataStreamer("Cache1")) {
                    streamer.allowOverwrite(true);
                    for (int i = 0; i < 5; i++) {
                        futures.add(streamer.addData(i, i));
                    }
 }

When I was debugging addData method, I could see that for every addData
operation there are 3 GridFutureAdapter$Node objects which get created. They
happen at

a) When a listener is attached to a GridFutureAdapter
b) When a listener is attached to a SilentCompoundFuture (I am not sure of
its use actually)
c) While updating an entry in PerStripeBuffer 

All the three GridFutureAdapter$Node objects get Garbage Collected when
flushing happens, which is fine (I verified the same by taking jmap
-histo:live)

My question is that, If we are writing a 1 million entries then that means
that we are generating 3 million GridFutureAdapter$Node objects which will
occupy a lot of space in a clients heap (and if the entries are more the
space is proportional). 

Is there a way we can avoid creating these objects at all and if yes, can
you please explain how and what will be the impact ?

Regards






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to