I have the same problem.
Have you found a solution?
Anyone got a solution to this?
Is there maybe a way through script to purge memory?
Not a real solution, just a workAround.
Save, close and re-open documents during the execution.
Periodically restart InDesign.
Split execution in several part insted of a unique and big sequence
if you can.. obviously
and a lot of RAM