Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Wed, 24 Aug 2005 09:36:49 -0700
Which part of "you have a resource leak" do you have trouble
understanding?
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Roger Garrett" <RogerGarrett@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:58AC90AA-21A8-4A7A-94BD-F7AE8830AEA4@xxxxxxxxxxxxxxxx
> 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?
>
.
- Follow-Ups:
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Roger Garrett
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- References:
- HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Roger Garrett
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Eugene Gershnik
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Arkady Frenkel
- Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- From: Roger Garrett
- HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Prev by Date: Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Next by Date: Re: Httpapi.dll
- Previous by thread: Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Next by thread: Re: HELP!! CSocket and CAsyncSocket Consumes Memory Uncontrollably
- Index(es):