Search code examples
xodus

How to reduce the memory usage by a writing transaction?


It seems like Xodus uses the amount of memory proportional to the size of writing transaction (correct me if I am wrong, please). So for big transactions it can become a problem, and for my application I have to chose much larger heap size "just in case" of a large working set for Xodus. Are there ways to reduce the memory use? Config setting? Heuristics?


Solution

  • First possible approach is to split changes into batches and flush them using jetbrains.exodus.entitystore.StoreTransaction#flush one by one. For example if you want to insert 100K entities into database it's better to do that with batches.

    If you extensively use large blobs then it's better to store them into temporary files first.