1

We are very interested in using Chronicle Map in our project. Currently, we're trying to understand how to work with a persisted file. For example when I create Chronicle Map with

 ChronicleMap.of(String.class, String.class)
    .createPersistedTo(persistedFile) 

Is data from persistedFile will be loaded into RAM memory? Or it will be served from the disk.

Serhii Shemshur
  • 1,273
  • 3
  • 15
  • 21

1 Answers1

2

Is the data from the persistedFile will be loaded into RAM memory

No, the memory mappings will only load the blocks, as they are required rather than loading in the whole file. But this is a technicality, you can use chronicle-map as though it was all in memory as chronicle-map handles the memory mappings for you.

Rob Austin
  • 620
  • 3
  • 5
  • 1
    To clarify, it is served from disk as needed, and while in memory, it is not loaded again. This reduces startup time and allows maps to exceed main memory size by several times. +1 – Peter Lawrey Mar 05 '19 at 16:13
  • @PeterLawrey - If the ChroniceMap is built with `create()` rather than `createPersistedTo()` is it still backed with a (temporary) file, i.e. can the map still exceed main memory size? – dan.m was user2321368 Oct 25 '19 at 14:31
  • @dab.m without a file, native memory uses your memory + swap space and it depends on how much of those are free. – Peter Lawrey Oct 26 '19 at 15:17