There's no limit, that I know of, for the number of PDFs you can create. However, the Java heap space error means your server is running out of memory. This could be a multitude of issues. Are you saving all the PDFs in memory or saving them to your RAM drive in the loop? If the documents are of considerable size this will eat up your memory real quick.
Can you allocate more memory to CF? How about writing the PDFs to disk in the loop? A "last resort" option I've used before in similar situations is setting up a META refresh to reload the page while processing only a few items at a time (this doesn't work if using scheduled tasks, of course).
Thank you for your quick response. I managed to fix the problem by increasing the heap memory on my Coldfusion server(how you suggest) ,also I optimized the loop(which is a query) and the size of the documents(only 100 KB for a pdf file).
Great! Please mark your answer as the correct one.