Allocating memory outside JVM and using it inside JVM

后端 未结 2 553
清歌不尽
清歌不尽 2021-02-13 18:28

Is it possible to create a persistent memory object outside JVM memory that can be used inside the JVM as an object, so that it survives a JVM restart?

Particular idea i

2条回答
  •  情歌与酒
    2021-02-13 19:33

    You can use MappedByteBuffer yourself or you can use a data structure built on top of a MappedByteBuffer so it can be available on restart and even shared between JVMs.

    Chronicle-Map has a key-value store modelled as a ConcurrentMap. e.g. Map

    Chronicle-Queue is a journal of every event in your system e.g. a log you can consume in real-time.

    These are both open source and free and save you having to work out how to store and retrieve objects from a persisted store.

    Note: as these are off-heap and persisted, they can be TBs in size without impacting the GC pauses times.

提交回复
热议问题