I have a Java method that generates PDFs from HTML templates using the iText 7 library. The method works fine for generating a small number of PDFs, but when I try to generate a large number (e.g., 1000), I encounter an out-of-memory error.
I would appreciate any insights or suggestions on how to optimize this code to handle the generation of a large number of PDFs without running into out-of-memory errors.
Tausif Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.