GetHeapStatus always returns 0 for all fields! Why could this be? Regards,
SZ ----- Original Message ----- From: "Wilfried Mestdagh" <[EMAIL PROTECTED]> To: "ICS support mailing" <twsocket@elists.org> Sent: Monday, March 20, 2006 4:39 PM Subject: Re: [twsocket] Server problem (leaking memory) > Hello, > > That is a lot leaking ;( > Use GetHeapStatus and AllocMemSize to check at regular places in your > code to find out where it starts to eat... > > --- > Rgds, Wilfried [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > http://www.mestdagh.biz > > Monday, March 20, 2006, 14:34, Fastream Technologies wrote: > >> Hello, > >> Our multi-threaded web server leaks 16-32KB per socket now. I hacked a >> lot >> to make async ICS a MT web server but there has been many issues as ICS >> has >> no MT web server example. Note that this leak cannot be catched by >> CodeGuard. > >> I hope we can figure this out together. Up to triggerSessionclosed, >> everything is as usual except that in onconnect, a message is sent to the >> worker thread that only does: > > clientObject->>ThreadAttach(); > >> which works fine. > >> Now the problem starts here: > >> void __fastcall httpServerClientClass::WndProc(TMessage &msg) >> { >> if(msg.Msg == WM_HTTP_CLIENT_THREAD_DETACH) >> { >> httpServerClientClass *clientObject = >> (httpServerClientClass*)(void*)msg.WParam; > >> >> clientObject->serverThread->HTTPServerClientDisconnected(NULL, >> clientObject, msg.LParam); > >> clientObject->ThreadDetach(); >> FCloseInvoked = false; >> setState(wsInvalidState); > >> PostThreadMessage(serverThread->ThreadID, >> WM_DESTROY_HTTP_CLIENT, (WPARAM)clientObject, 0); >> } >> else >> THttpConnection::WndProc(msg); >> } >> //--------------------------------------------------------------------------- >> void __fastcall httpServerClientClass::TriggerSessionClosed(WORD ErrCode) >> { >> if(!FSessionClosedFlag) >> { >> FSessionClosedFlag = true; >> OnDataSent = NULL; >> setOnDataAvailableToNULL(); >> endOfResponse(); >> setState(wsClosed); > >> TCustomLineWSocket::TriggerSessionClosed(ErrCode); > >> PostMessage(Handle, WM_HTTP_CLIENT_THREAD_DETACH, >> (WPARAM)this, ErrCode); >> } >> } >> //--------------------------------------------------------------------------- > >> What I am trying to avoid by setting FState = wsClosed in trigger.. is to >> stop the close() routine called after trigger... being executed after the >> WM_HTTP_CLIENT_THREAD_DETACH because everything must be in exact order. >> If I >> do not set state to wsinvalidstate or anything other than wsclosed, then >> the >> window is leaked. Oops, I almost forgot to show you the >> WM_DESTROY_HTTP_CLIENT: > >> case WM_DESTROY_HTTP_CLIENT: >> { >> httpServerClientClass *client = >> (httpServerClientClass*)(void*)msg.wParam; > >> client->ThreadAttach(); > >> delete client; > >> break; >> } > >> I have been working on this bug since Friday and it is very annoying so >> hope >> you can help me! > >> Best Regards, > >> SZ > > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be