Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7191

Delphi Indy connect/disconnect Not enough memory resources are available to process this command

$
0
0

I localized problem of my Delphi service app.

Now I have one test server with Windows Server 2019, RDP.

Simple test code, connecting to local TCP server and disconnect:

for i := 1 to 1000000 div 100 dobeginsleep(100);Caption := 'STRESS TEST: '+ inttostr(i * 100);Application.ProcessMessages;for j := 1 to 100 dobegin  thread := TThread.CreateAnonymousThread(  procedure  Var tcpClient : TIdTcpClient;  begin      try        tcpClient := TIdTCPClient.Create(nil);        tcpClient.Host := '127.0.0.1';        tcpClient.Port := RollControl_Svc.TCPServer.Bindings[0].Port        tcpClient.Connect;        tcpClient.IOHandler.ReadTimeout := 1000;      finally        FreeAndNil(tcpClient);      end;  end);  thread.FreeOnTerminate := (j > 1) and (j < 100);  if thread.FreeOnTerminate then thread.Start else  begin    thread.Start;    thread.WaitFor;    thread.Free;  end;end;

After 20K operations on the test machine, an error occurs:

Thread creation error: Not enough memory resources are available to process this command.

At my work with the machine everything is fine, 1M operations have been done. I have Delphi XE3, latest Indy version, what's wrong? Maybe there are some peculiarities when working in RDP?


Viewing all articles
Browse latest Browse all 7191

Trending Articles