Improving memory usage for PDF files loaded by chunks

as described in #5329, this significantly reduces memory usage for large files loaded by chunking
Nit: please use a capital letter at the start of sentences, and add a period at the end.

This also applies in multiple places below.