Search code examples
javadictionarysizechroniclechronicle-map

Maximal number of ChronicleMap entries


How many entries theoretically can ChronicleMap contain at maximum? What is the number of maximum entries one can put to ChronicleMap?


Solution

  • The theoretical maximum is limited by the virtual memory you can have. This can be as low as 128 TB depending on your OS. By comparison Chronicle Queue doesn't have this limit, as it swaps in memory mappings, but would be much slower for random access as a result.

    In practice, limiting the size of your map to 2x - 40x main memory size seems to be a realistic upper bound.

    In short, the smaller the entries, the more you can have.