I test the following code
#include <boost/property_tree/xml_parser.hpp>
namespace pt = boost::property_tree;
int main()
{
{ //1
pt::ptree xml;
pt::read_xml("very_big_xml.xml", xml);
// xml.clear(); //destructor should do the job
}
{ //2
pt::ptree xml;
pt::read_xml("very_big_xml.xml", xml);
}
}
After first part, my application ocuppies huge memory amount (~6GB) and it crashes on second part because of lack of memory. Should I manually release property tree? Documentation says the destructor should clean up.
NOTE: uncommenting xml.clear();
doesn't help.