void xmlTreeCleanup(xmlDoc doc [, int options])


  • doc - the xmlDoc to remove unlinked orphans from

  • options - specifying 1 will cause verbose messages to be printed about what it's cleaning up

xmlTreeCleanup() can be used in very specific circumstances to assist with memory management of XML trees. Most code will never need to call this.

If you have a situation where:

  • You have a long running Vortex process, that

  • interacts with a single xmlDoc over a long period of time and

  • repeatedly creates and unlinks nodes via xmlTreeUnlinkNode
then the memory used by Vortex can steadily climb, as unlinked nodes are normally not freed until the xmlDoc they came from is freed. Calling xmlTreeCleanup() forces the xmlDoc to free any unlinked nodes that do not have any Vortex variables set to them.


<$ret = (xmlTreeCleanup($doc))>

Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.