ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Schmitt <peter.schmitt....@gmail.com>
Subject Reusing Ignite-Marshaller leads to a Memory-Leak
Date Sat, 21 Jan 2017 22:46:58 GMT
Hello Ignite-Community!

I would like to use the Marshaller from Ignite for de-/serialising objects.
I would like to re-use it, because it's very fast and I'm using Ignite
anyway.

I tried it with:

//every thread gets the Marshaller via:
GridKernalContext ctx = ((IgniteKernal) ignite).context();
Marshaller marshaller = ctx.grid().configuration().getMarshaller();

->

byte serializedResult[] = marshaller.marshal(obj);
or
Object deserializedResult = marshaller.unmarshal(serializedResult,
ctx.getClass().getClassLoader());

In a simple test it worked very well (and fast).
However, once I'm using larger Objects (e.g. 2000 instances each ~1kb after
marshalling) and store the results in a map, the Heap consumption grows a
lot (almost 2gb in few seconds).
If I store the same objects in an Ignite OffHeap-Cache, the (OffHeap)
memory-consumption is minimal.
In the debugger I saw that the heap grows once those 2000 instances get
processed.
(A manually triggered GC can just release few mb.)

I even tried to re-use the marshaller, but nothing changed.
At runtime BinaryMarshaller is used which wraps GridBinaryMarshaller.

Any hint to get rid of the leak is appreciated,
Peter

Mime
View raw message