[Twisted-Python] Way to fix memory leaks of external c module

Maris Ruskulis maris at chown.lv
Mon Nov 30 09:22:29 MST 2009


Itamar Turner-Trauring (aka Shtull-Trauring) wrote:
> On Sat, 2009-11-28 at 15:05 +0200, MārisR wrote:
>
>   
>> I wondering if its possible to load utidylib in thread, do processing
>> and after this kill thread and release memory? Or maybe something like
>> deferToProcess?
>>     
>
> 1. You should report the bug to the utidylib authors, so they can fix it
> or pass it on to tidy authors.
>
> 2. A thread wouldn't help... but a process certainly would.
> https://launchpad.net/ampoule may be helpful if you don't want to
> implement your own process wrapper, or you could just run a sub-process
> that takes input and output filenames on the command-line and pass data
> around that way.
>
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>   
Thanks for replay!
I tried pytidylib, and have same issue with memory leak, unfortunately I 
couldn't report bug to, because, tidylib is self patched by one c 
programmer, but problem, is that he have no more time for it.
After day on playing with ampoule, I got it working :) But I run into 
another problem, AMP value length is limited to 64kb. Seems its a struct 
pack limitation. Probably I could split message into chunks <64kb each 
and feed to amp something like: pp.doWork(Tidy, html={'chunk1':  data1, 
'chunk2':  data2...} )
or maybe there is more easy/clean way?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20091130/b4f2d588/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maris.vcf
Type: text/x-vcard
Size: 216 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20091130/b4f2d588/attachment-0002.vcf>


More information about the Twisted-Python mailing list