Using MapDb to avoid memory bottleneck