[reportlab-users] memory error

Paul Barrass paul.barrass at safeonlinebilling.com
Wed Jul 8 16:56:42 EDT 2009

Andy Robinson wrote:

> 2009/7/8 Robert Robert <robertrobert93 at yahoo.com>:


>> Hello All,

>> I am creating a pdf file in which I include images. A lot of them. When I

>> open the python script with IDLE, the first time it works perfectly. When I

>> want to recreate the PDF file I get a memory error as follow;


>> In string.py"

>> return sep.join(words)

>> MemoryError



> We construct the PDF file in memory. At a certain point, you run out.

I think the problem is that the PDF generation fails the /second/ time,
so presumably there is enough memory available, and it's not being fully
freed between runs. I see a similar problem when generating thousands
of PDFs, the memory usage steadily increases, though so far not to the
point of memory exhaustion. Is there something we're supposed to do to
'reset' RL between outputting one PDF and starting on the next? [I'm
saying that it is RL that's causing the memory usage since it's never
become a large enough problem for me to look into it, it could easily be
a memory leak elsewhere]

Paul Barrass.

More information about the reportlab-users mailing list