Keeping in memory the information required for the index files during the simulation is costing far too much in term of memory but also performances. To reduce this, I have moved all the logic into the reader where we will not have as much information to track.
Some other changes that are worth to mention: