Pdf memory issue