java - Using MapDB efficiently (confused about commits) -


i'm using mapdb in project deals billions of objects need mapped/queued. don't need kind of persistence after program finishes (the mapdb databases temporary). want program run fast possible, i'm confused mapdb's commit() function (which assume relevant performance), after reading docs. questions:

  1. what commit do? working understanding serializes objects heap disk, freeing heap space. accurate?

  2. what happens references objects committed? cleaned gc, or somehow 'reference' object on disk (with mapdb making transparent?)

ultimately want know how use mapdb efficiently can, can't without knowing commit() for. i'd appreciate other advice might have using mapdb efficiently.

the commit operation operation on transactions, find in database system. mapdb implements transactions, commit 'make changes i've made db permanent , visible other users of it'. complimentary operation rollback, discards of changes you've made within current transaction. commit doesn't (directly) affect in memory , not. might want @ compact() instead, if you're trying reclaim heap space.

for second question, if you're holding strong reference object continue holding strong reference. mapdb isn't going delete you. should think of mapdb normal java map, of time. when call get, mapdb hides whether it's in memory or on disk , returns usable reference retrieved object. retrieved object hang around in memory until becomes garbage, else.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -