Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
138 views
in Technique[技术] by (71.8m points)

java - MapDB File Size of Maps

I am very new to MapDB and i am trying to store some data with it. But everytime i create a new Map it will have like 17MB of size. But i need very many maps with like no data in it.

Is there a way to reduce the file size? Or maybe increase it every time new data is being stored?

        this.storage = DBMaker
            .fileDB(storageFile)
            .transactionEnable()
            .fileMmapEnable()
            .closeOnJvmShutdown()
            .fileMmapEnableIfSupported()
            .allocateStartSize(10 * 1024)
            .allocateIncrement(10 * 1024)
            .make();

Everytime i create a new Map i do this

map = this.storage.hashMap(createMapName(chunkManager.getChunk()), Serializer.STRING, Serializer.BYTE_ARRAY).createOrOpen();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...