[pyar] Problemas de memory leak

John Rowland Lenton john.lenton en canonical.com
Mar Oct 5 14:21:49 ART 2010


On Tue, Oct 05, 2010 at 02:14:12PM -0300, Roberto Alsina wrote:
> Tengo un reporte de bug en rst2pdf de que pierde memoria. Acá esta:
> 
> http://code.google.com/p/rst2pdf/issues/detail?id=343
> 
> Pero lo basico es esto:
> 
> ------------------
> 
>     class default_object(dict):
>         ''' By default, RSON objects are dictionaries that
>             allow attribute access to their existing contents.
>         '''
>         def __init__(self):
>             self.__dict__ = self
> 
> The problem is that since dict is implemented in C, if there's a circular 
> reference to itself, the object would not get garbage collected.
> 
> ------------------
> 
> Que me sugieren?

agregale __getattr__ (y __setattr__, y __delattr__ si son relevantes),
que sean copias de (o proxies para) __getitem__ y etc.
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20101005/a1bb3886/attachment.sig>


More information about the pyar mailing list