Use the sitemap index option, it'll create an index of x amount of sitemaps, each map would be X size based on the paramater in the sitemap script...
EX:
You have 100000 threads, you set 25k links in the sitemap, so the index would push out an index with 4 sitemaps, each sitemap would push an offset of 25k, so the first would be 0-25k, second 2501-50k, etc...
I'd recommend using no more than say 25k chunks however, makes the query a little easier to deal with lol...