I'm working with large graphs that are stored on disk in a binary format. Reading the graph from disk (SSD) and constructing the graph takes roughly an hour. Once constructed the graph never changes. The graph takes roughly 50GB of memory, which isn't a problem for the server. However, we often want to do lots of experiments on the graph and paying the hour graph-loading time gets expensive. I'm wondering if there is any way to persist the object in memory so that the JVM can essentially locate the object in memory.
I know the JVM has memory sharing between processes, but I haven't see anything that lets you share whole object without serializing the object to bytes (which would likely be slow given the expensive reconstruction). Database solutions also seem slow because of the bulk of the object (50GB). Since we aren't modifying the object (it's effectively static), I'm not concerned about concurrency issues between processes.
The best idea I've seen is to use a FileChannel to map the serialized object into memory using an always persistent JVM and then have the second JVM read from that FileChannel to deserialize the object. Any other suggestions would be much appreciated!