-
Notifications
You must be signed in to change notification settings - Fork 17
Description
In itstool 2.0.4, we started calling freeDoc on xmlDoc object when we're done with them. libxml2's python bindings require manual frees. Previously, we were leaking them, which could cause runaway memory consumption. This was expecially true with --keep-entities or --load-dtd, which increases the size of the xmlDoc objects in memory.
Unfortunately, we're now freeing objects that are still in use, causing crashes. What I've figured out so far is that this only happens when we run scan_node in get_translated. This method is responsible for finding placeholder elements and recursively merging translations. A likely culprit is that, somewhere in prepping the new node to insert, we're not doing a deep enough copy, resulting in some dangling pointers to the xmlDoc we free.