1

I'm evaluating MapDB for an application. I create the DB following way.

DB db = DBMaker.fileDB(new File("mapdbtest1")).cacheHashTableEnable()
                .cacheSize(50000).closeOnJvmShutdown()
                .encryptionEnable("password").make();

After putting 50000 objects in the DB and then calling GC explicitly, the used size is too less and looks like the objects are not in memory cache any more. I was expecting the cacheSize no. of objects to be always in memory, irrespective of GC or OOM and rest of them be swapped.

=======================
Memory : after committing to DB
free memory: 1426 MB
allocated memory: 2860 MB
used memory: 1433 MB
max memory: 3641 MB
total free memory: 2207 MB
=======================
=======================
Memory : after gc
free memory: 2479 MB
allocated memory: 2494 MB
used memory: 14 MB
max memory: 3641 MB
total free memory: 3626 MB
=======================

Is my understanding wrong ?

4

0 回答 0