I just inherited a PHP project that generates large PDF files and usually throttles through several thousand pages and several concerts of server memory. The project used PDFLib to generate these files in memory.
I was tasked with fixing this, so the first thing I did was send the PDFLib file to a file instead of creating it in memory. The problem is that it still seems to be creating PDF memory. And most of the memory never returns to the OS. In the end, all things choke and die.
When I ask the program to create only fragments of large PDF files, it seems that the data is not completely cleared to the file on end_document (). I get no errors, but the PDF is not readable and opening it in a hex editor makes it obvious that the stream is incomplete.
I hope someone has similar difficulties.
source
share