
There is a bug in std::basic_iostream in VC8 (http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=e...) that affects all classes derived from it. During the output of a ptime, a basic_stringstream object is created/destroyed and that is causing the memory leak. I personally think Microsoft should release a patch for this but it looks like they won't until the next release. You might be able to obtain a hotfix by contacting Microsoft Technical support. On the other hand, std::basic_ostringstream/std::basic_istringstream do not suffer the same memory leak. And maybe data_time library can change to use them instead of std::basic_stringstream (line 304 in time_facet.hpp as of release 1.33.0). I haven't really looked into data_time library so I can not say this for sure. HTH, Sean "Alo Sarv" <alo.sarv@gmail.com> wrote in message news:14a0620d0602161156s55640094xabd31ed80ebde1cb@mail.gmail.com...
The following test app illustrates a memory leak that I'v been able to produce so far with MSVC 8.0 (earlier versions not tested). GCC 4.0 seems to be unaffected. The leakage in case of this test app is around 12kb/s.
#include <iostream> #include <boost/date_time/posix_time/posix_time.hpp> using namespace boost::posix_time; int main(int argc, char *argv[]) { ptime t(second_clock::local_time()); while (true) { std::cout << t << "\r"; } return 0; }
Tested against Boost 1.33.1 release.
Compiled with cl test.cpp /I c:\boost_1_33_1 /D _CRT_SECURE_NO_DEPRECATE /EHsc /D BOOST_ALL_NO_LIB
-- Alo Sarv
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost