I think the reason it is doing this is because as it goes through all of the different graphs it then runs out of memory probably because it isn’t releasing it properly.
Why don’t you try creating about 3 or so programs each of which do a few graphs instead of one program doing all the graphs:
Program 1: Graphs 1-8
Program 2: Graphs 9-16
Program 3: Graphs 17-25
Hope this helps @FakeDIY : )