Hi guys,

Found this thread while searching to solve my problem ...
anyone an idea why this snipet leaks?

void testMemoryLeak()
{
	HINTERNET hSession = WinHttpOpen(NULL, WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
	WinHttpCloseHandle(hSession);
}

a 20'000 loop brings memory up to 19MB

VS2008 on Win7/64 building a console application Win32

Cheers
Claus

Ancient Dragon commented: cross post and thread hijack -4

I see the same behavior using vc++ 2010 express on 64-bit Windows 7. The memory eventually went back down to normal level after a couple minutes. I think the problem is that the program does not release memory back to the operating system so that Task Manager can see it, instead it just adds released memory to a free-list inside the program.