org.mapdb / DBMaker / Maker / closeOnJvmShutdownWeakReference

closeOnJvmShutdownWeakReference

fun closeOnJvmShutdownWeakReference(): Maker

Adds JVM shutdown hook and closes DB just before JVM. This is similar to closeOnJvmShutdown(), but DB is referenced with WeakReference from shutdown hook and can be GCed. That might prevent memory leaks under some conditions, but does not guarantee DB will be actually closed.

DB.close() removes DB object from shutdown hook, so DB object can be GCed after close, even with regular



Return
this builder