Hello,
I am trying to find what appears to be a memory leak somewhere in my server, which is specially present when our unit test suite runs the “concurrent” users tests. This tests create lots of different threads and each thread does some calls to the server.
So far I haven’t find anything obvious, but there is one thing that I find odd. I have extensive logging on the server and I log each call of MemSessionManagerSessionCreated. At the end of the concurrent users tests I can see 18,007 calls to that event. I also log the SessionDeleted event. And of those I can only see 602 calls. So there is a clear difference between the two, and maybe that explains that the memory usage of the server doesn’t go back to baseline when running that tests.
Now, another strange thing and I think this could be the reason behind the asymmetry is: most of the calls to SessionCreated have a SessionId of 00000000-0000-0000-0000-000000000000. But all of the calls to SessionDeleted have a non-empty SessionId.
In the client side I set the Message.ClientId property to the SessionId I got from the Login function, which is called at the beginning of each threaded test. And all the methods called from the server require a session and they don’t fail. I can see in the methods I have logged that info the expected SessionId… so I am not sure where are those session with empty Id created and definitely can’t see them being destroyed…
On the other hand: I have a counter for the number of active sessions and it shows an expected number (a maximum of around 115 session), nothing near the number of calls I see on the log…
Am I looking at this wrong? Is this expected?
The client and the unit tests are on .NET and the server is made in C++Builder. We are using the latest version, 1623.
Some more info:
The baseline as shown by Process Explorer before any client connects is around 250Mb.
Originally I had the client connect using SuperTCP transport. In that case, after finishing the tests, the server stays around 600Mb or Private Bytes.
In changed the transport to TCP and now it’s higher! its around 960Mb after running the same tests.
In both cases the memory stays like that no matter what. The client already disconnected and the process closed, the session expiry already reached (although the session count is 0 after the client finishes anyway, so it wouldn’t appear to be lingering sessions). Seems to be something related to the transport channels… and the number of connections? Any ideas?