stringstream memory leak

Started by
1 comment, last by instinKt 16 years, 11 months ago
Is there a problem with stringstream in VS2005? I thought I had a memory leak in my engine and eventually tracked it down to a stringstream. Even if I didn't use it, just declared it, it leaked memory. So I tried this:

#include <iostream>
#include <sstream>
using namespace std;

int main()
{
	while(1)
	{
		stringstream Temp;
	}

	return 0;
}

Can anyone else try it and watch the memory usage in the process view of task manager? In release it runs fine, but in debug the memory usage just keeps going up.
Advertisement
Well, it would appear you aren't actually crazy and this is a documented bug that was fixed with Visual Studio 2005 Service Pack 1. Get it here! Hope that helps.

edit: it appears I don't have SP 1 yet either. Better get on that.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

What a spinout. I was considering coming here and asking about this exact same problem a few hours ago. I just did a google search and found the solution though. I guess everyones doing memory debugging this time of the year ;)

This topic is closed to new replies.

Advertisement