Dear R helpers I have a problem of releasing memory after having read .xml-files using the xml package (version 3.98-1.1, R 3.0.2, Windows 7, 64bit). The problem has appeared previously and several solutions/bug fixes have been proposed. I went through many of these and have also read (and understood?) Duncan Lang`s Memory Management page, outlining the counter-based memory release for nodes and documents. However, the problem persists, i.e., filed<- ... # some PubChem .xml file path doc<-xmlTreeParse(file=filed,useInternalNodes=TRUE) get_data<-getNodeSet(doc,path="//r:PC-InfoData", c(r = "http://www.ncbi.nlm.nih.gov") ) will not allow me to release "doc" from memory using combinations/orders of rm(), free(), gc() for doc and get_data. I ended up using .Call("RS_XML_forceFreeDoc", doc) and monitoring the counter settings with .Call("R_getXMLRefCount", ...) - but that cannot really be the solution, not? What am I doing wrong? Thank you very much for your help, Martin [[alternative HTML version deleted]]