This is an eternal issue that finally I decided to look deep into it and that was slowly killing our servers.
The problem happens while using the NON legacy event sink registration, in other words when calling the RegisterEventClient(GuidToAnsiString(ClientId),EID_XXXSink) from the server, usually during the login operations.
This ONLY happens if you use Olympia Server, InMemory Manager doesnt suffer this issue.
The case is reproducible with the HTTPChat sample that comes with the latest version of RO/DA for Delphi.
Simply enable to report memory leaks on shutdown on the HttpChatServer.pas file:
“
ReportMemoryLeaksOnShutdown:= DebugHook<>0;
Application.Initialize;
Application.Title := ‘HTTP Chat Server’;
Application.CreateForm(THTTPChatServerMainForm, HTTPChatServerMainForm);
Application.Run;
”
Set the build configuration to debug, rebuild the project and run it. Select Olympia Server.
Run one Chat client, login, logout. On the Chat Server close the application (click on the [x]) and see the memory report about the memory leaks.
It will not matter if you use Bin or JSON message, or if you stop the chat server. The memory leaks will show up.
Obviously this issue is HUGE, and after some hours it can swallow hundreds of megabytes until it eventually kills your services.