Does ChronicleMap.Close() - release ChronicleMap objects from JVM via GC ?

26 views
Skip to first unread message

Felix

unread,
Sep 14, 2016, 6:20:06 PM9/14/16
to Chronicle
I am creating temporary ChronicleMap objects in my program.
If I apply: ChronicleMap.Close() and my method exists (the ChronicleMap object was created in given method - its scope is the method only)
will  Chronicle Map API release the instance normally as in standard Java, JVM will clear it via GC (garbage collection) or will there  remain some residual in the on-heap or off-heap areas?
Thus, creating temporary ChronicleMap objects would be rather discouraged?
Thank you.

Rob Austin

unread,
Sep 14, 2016, 6:40:23 PM9/14/16
to java-ch...@googlegroups.com
ChronicleMap.close() releases the reference to the off heap memory. Usually, no on heap data objects are held via chronicle map. 

Sent from my iPhone

On 14 Sep 2016, at 23:20, Felix <felixu...@gmail.com> wrote:

ChronicleMap.Close()

Roman Leventov

unread,
Sep 14, 2016, 6:47:00 PM9/14/16
to java-ch...@googlegroups.com

I just found that ChronicleMap objects actually leak via threadLocals, until any thread, used to access a Chronicle Map, is alive. This is a bug and should be fixed, but as of now, creating a lot of Chronicle Maps and accessing them from same long living threads may lead to heap and ThreadLocalMap pollution.


--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicle+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Felix

unread,
Sep 14, 2016, 7:24:19 PM9/14/16
to Chronicle


On Wednesday, September 14, 2016 at 3:20:06 PM UTC-7, Felix wrote:
I am creating temporary ChronicleMap objects in my program.
If I apply: ChronicleMap.Close() and my method exits (the ChronicleMap object was created in given method - its scope is the method only)

Felix

unread,
Sep 14, 2016, 7:31:46 PM9/14/16
to Chronicle
Thank you for the advisory, Roman.  I'll try handling the temp ChronicleMaps in a separate thread for now, which should release the CM objects with the terminated thread.
Will you please post a note once there be a fix for the leak? Thx.


On Wednesday, September 14, 2016 at 3:20:06 PM UTC-7, Felix wrote:
Reply all
Reply to author
Forward
0 new messages