Re:Tracking Down a Python Memory Leak
by nerdponx on Wednesday December 07, 2016 @12:45PM
(#13124445)
No kidding. I actually once had a freaky memory leak of my own that I was never able to fix. I was in fact using libxml2 there, I wonder if that was the cause.
[ Parent
| on HN ]
Re:Tracking Down a Python Memory Leak
by bbernard on Wednesday December 07, 2016 @12:54PM
(#13124514)
There's more than one leak actually. It's quite a party :)
Re:Tracking Down a Python Memory Leak
by rudolf0 on Wednesday December 07, 2016 @02:23PM
(#13125357)
Exact same thing. Odd unsolved memory leak, using lxml for HTML parsing.
I think I'll stay away from it in the future. Unfortunate, since it's the fastest HTML parser in Python that I know of.
Re:Tracking Down a Python Memory Leak
by maxerickson on Wednesday December 07, 2016 @02:59PM
(#13125684)
Have you compared it to the C implementation of ElementTree?
With stanzas like
for event, n in ElementTree.iterparse(xmlfile, events=("end",)):
if n.tag == "blar":
# do stuff
n.clear()
it doesn't even take much memory to parse files of arbitrary size.