Open xbit opened 6 years ago
fst allocates a byte array buffering at least the complete output of a stream for performance reasons. As its a single object, it has practically no drawback on GC duration, however there still is a peak in mem consumption.
In order split this. one could write key, values of a hashmap using FSTConfiguration.asByteArray(..) and write those to an ordinary ouput stream, however object link restoration (links to same objects) won't work this way.
When trying to serialize a complicated Object that has a huge HashMap the memory usage is doubled. The memory goes from 200MB to about 405MB. I'm serializing it this way:
Is there a way to lower memory usage when serializing? Or am I doing something wrong?