int
_tmain(int argc, _TCHAR* argv[]){
for(int i = 0; i < 100000; ++i){
::Sleep(1);
std::basic_stringstream<TCHAR> str;
str << _T(
"Current iteration: ") << i;}
return 0;}
CRT: Multi-threaded debug or Multi-threaded
I compiled and ran the same piece of code in VC++ 2003 and I don't see ANY leaks!
Any ideas Please help!
Thanks in advance

stringstream causes memory link VC++ 2005?
vbcoderwquestion
As I mentioned you will have to request such patch first through PSS so that to be considered. Other wise, it might end up being fixed in the next release or service pack.
Also, it all depends on the results of the investigations that are currently being carried.
Thanks,
Ayman Shoukry
VC++ Team
Fullboy
If/when the VC++ team comes up with a fix or a workaround, how can I (or anyone else who's interested in the workaround) expect to be notified Should I continue to monitor the bug submission page
Thanks in advance.
Ben S
If you don't see an update to the link in the next couple of days, feel free to ping me on the forums and I can take a look,
Thanks,
Ayman Shoukry
VC++ Team
cojimar
for this issue, we will be in trouble
Thanks,
-Madhu.
Jesse Motes
Ayman (or any MS representative),
Any idea when we can expect to get a fix/workaround for this bug It would suck to not be able to use stream classes (esp stringstream)!
Thanks.
TheSoddy
Thanks in advance for taking the time to log the issue!
Thanks,
Ayman Shoukry
VC++ Team
Brian Z
Hi,
Thanks for having an interest in the issue. Please use http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=e08bd793-3fef-40ff-adda-ed313e0eafcc to vote on it as well as add comments regarding needing a patch for it or a workaround. Also, you might need to contact PSS to request a private fix for it. As soon as folks look into the issue they should have more details there (at the above link)
Once more, thanks and please keep an eye on the link. From my side, I will try to get in contact with the responsible folks and point them to the bug.
Thanks,
Ayman Shoukry
VC++ Team
Mega_bit_dk
Here's the link to bug report that mike_n created:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=e08bd793-3fef-40ff-adda-ed313e0eafcc
If you can't get to the link, the Bug ID is FDBK40119.
Looking forward to the workaround...
Thanks!
Le Van Quy
From what I traced, the basic_iostream inherits from both basic_ostream and basic_istream - both of which virtually inherit from std::basic_ios, which inherits from ios_base. In ios_base::_Init(), the first line is _Ploc = 0;, and the last line is _Ploc = _NEW_CRT locale; (this is in the file xiosbase ) - well, since _Init() gets called for basic_ostream AND basic_istream, that _Ploc pointer is shared, and gets overwritten (with the _Ploc=0 line), and assigned a new locale object - now this is SUPPOSED to be the same "global_locale" object, but it's not - it gets assigned a new locale object, and I think the original object never gets its reference count decremented, so it never gets freed...
WmS
Thanks,
Madhu.
Comet87
Could you send me the bug link and I can make sure someone look at it straight ahead They should be able to provide at least a workaround.
Thanks,
Ayman Shoukry
VC++ Team
Michael Sabbag
Is there emergency patch coming out for the std::iostream memory leak..
To me its a 'show stopper'. I can't even suggest our development team to migrate to Visual C++ 2005 by knowing the fact that there is a memory leak..!!!!
Thanks,
Madhu.
Leo kaplin
Make sure to let them aware of the bug link.
Thanks,
Ayman Shoukry
VC++ Team
sweeper
This is a "cannot ship app until it's fixed" bug - is there any fix we can apply ourselves to the standard library sources until a fix is generally available Can someone who's looked into it please make a quick post here
Thanks
Ted.