
I recently asked this on stack overflow boost with icu u32_regex memory leak / cache on Win32http://stackoverflow.com/questions/6867664/boost-with-icu-u32-regex-memory-l... but haven't been able to solve issue yet so thought I would ask here as well.
There are a number of issues here: 1) Your call to u_cleanup() occurs while a u32regex object is still in existence, so any ICU data being cached is actually still being used at that point. 2) Boost.Regex does cache some internal data for improved performance - this is relatively small and gets cleared after main() exits. 3) Point (2) means that a call to _CrtDumpMemoryLeaks() before main exits will report leaks, where as using something like: struct cleanup { ~cleanup() { _CrtDumpMemoryLeaks(); } }; cleanup c; To report leaks results in no leak reports. 4) Other leak detectors such as valgrind and VLD report no errors (and give much more useful reports than the brain-dead MS ones IMO). HTH, John.