[reportlab-users] Memory Leak in rl_accel.c
Robin Becker
reportlab-users@reportlab.com
Mon, 7 Apr 2003 18:26:15 +0100
In article <OFB37FAD3A.6A18A88A-ON41256D01.0059FA72@ubitrade.com>,
amaury.forgeotdarc@ubitrade.com writes
>Hello,
>
>While trying to embed the PDF generator into our application, I noticed
>a slow increase of the memory usage: approx. 15Mb for 1000 pages,
>even after the documents are saved and closed.
>
>Investigations showed that there is a memory leak in the
>fp_str function which is rewritten in C,
>in the rl_accel.c source.
>
>I am not a Python/C API expert, but on line 470:
> if((pD=PyNumber_Float(pD))) d = PyFloat_AS_DOUBLE(pD);
>PyNumber_Float returns a new reference which lacks a Py_DECREF,
>which I simply add some lines later.
>This seems to correct the problem.
>
>Has someone noticed this before?
>What is the process to correct this problem?
>
I think we must have noticed this before. At my line 470 I have
if((pD=PyNumber_Float(pD))){
d = PyFloat_AS_DOUBLE(pD);
Py_DECREF(pD);
}
these seem to have been changed in version 1.31 somewhen about 20030105
>--
>Amaury Forgeot d'Arc
>
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users
--
Robin Becker