The memory was increased to 256MB on the server, also have a 10 hour timeout set. The sitemap is also set to make only 5000 urls per sitemap. I did that to ease up on the script a bit instead of having 40000.

There are about 50,000 pages on the site.

Any ideas as to what it could be that keep causing the script to loop back to the auto-restart?