Randy,
I’m just guessing at your code, but if you’re doing 40000 individual string concatentations, and assuming that each customer record produces an XML fragment of N characters, then over the course of the loop, Java will need to allocate 800,020,000 x N chars of storage. That will take some time, and put a big load on the GC. 24 hours worth, even 
(BTW, the same sort of issue applies to incrementally building string or document lists, as WM implements them internally as arrays, and creates new copies when the list is extended.)
You’d be better off creating a single StringBuffer of 40000 x N chars, and appending the XML fragments to it, or breaking the extract into multiple parts. You could wrap the StringBuffer in some services to allow it to be used in Flow, or you could just do the whole construction job in a single Java service.
HTH,
Michael.
#webMethods#webMethods-General#Integration-Server-and-ESB