Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably



IT'S WINDOWS VERSION SENSITIVE !

I did some extensive testing of this socket create/delete problem. It turns
out that it is sensitive to which version of Windows it is run under.

I wrote a really simple MFC dialog-based app that basically has a button
which, when clicked, does a large number of CAsyncSocket creations and
deletions.

The loop looks like this:

for (n = 0 ; n < nCount ; ++n)
{
CAsyncSocket* pSocket = new CAsyncSocket;
if (!pSocket->Create(0))
{
MessageBox("CAsyncSocket::Create failure","Socket problem");
}
delete pSocket;
}


By watching the Windows Task Manager I can see that the size of the
application increases as the sockets are created/deleted. Doing 10,000 socket
create/deletes causes the app to increase in size by over 12Mb. That is, that
happens when I run the app under Windows XP Home Edition. If I run it under
Windows 2000 there is no memory problem.

Does Microsoft know about this? Is there some way that I can notify them of
this situation?

.