[reportlab-users] Memory consumption of a "simple" document seems excessive

Robin Becker reportlab-users@reportlab.com
Thu, 8 Jan 2004 09:08:21 +0000


In article <PGECLPOBGNBNKHNAGIJHIEHKIDAA.andy@reportlab.com>, Andy
Robinson <andy@reportlab.com> writes
.....
>It says:
>
>More than 3 pages generated without content - halting layout.
>Likely that a flowable is too large for any frame.
>
>
>Better still would be to give the identity of the next flowable in
>the queue, I'll try to add that later.
>
>- Andy
>
....

I just looked at Andy's solution and although technically it works, it
actually addresses a symptom of the problem and not the problem itself. 

As a counter example we ourselves recently had to ensure that a
particular document had a length divisible by 4 thus possibly causing 3
blank pages.

Any fixed number of blank pages will break somebody's document. As
example printing an exercise book might involve only the page drawing
functions with no real flowables per page.

In addition it's feasible that some flowables might break this by
causing output and then having to be split. I'm not absolutely sure
tables don't do this.

I think the real problem is that a particular flowable can be presented
more than once without changing its identity/value, the split method is
not required to produce children that differ from the parent.

In the case of something that's too large our algorithm punts the
decision to the next frame. Only the document knows whether a particular
flowable will fit on any frame so we treat frame size errors as being
less fatal than they sometimes are. The document level doesn't know
enough about the flowables to be sure about why an error occurred. 
-- 
Robin Becker