#1 2017-02-17 07:33:06

vga
Member
Registered: 2016-08-18
Posts: 15

Memory usesed by mormot Server increasing all time when client runing

mOrmot is very grate product and I like it very much!

thease days, my server report "Out of memory" error.

my client code:

procedure TForm1.btnTestClick(Sender: TObject);
var
  Data, SQL: string;
  Data_ID: Integer;
begin
  Data_ID := 1;

  while not chkStop.Checked do
  begin
    Application.ProcessMessages;
    Caption := IntToStr(Data_ID);
    Data := widestringToUtf8('11123錦');
    SQL := Format('update t_data set Dat=:(''%s''):,PostTime1=now(),s1=2 where Data_ID=%d', [Data, Data_ID]);

    if not ExecuteSQL(sql, []) then
    begin
      ShowMessage('Fail to save data!');
      Break;
    end;
    Inc(Data_ID);
  end;
end;

when runing, I found the  memory usesed by mormotServer increasing。

Last edited by vga (2017-02-21 08:33:32)

Offline

#2 2017-02-17 07:36:19

vga
Member
Registered: 2016-08-18
Posts: 15

Re: Memory usesed by mormot Server increasing all time when client runing

function ExecuteSQL(FormatSQLWhere: string; const BoundsSQLWhere: array of const): Boolean;
var
  Query: IRemoteSQL;
  aSQL: RawUTF8;
begin
  aSQL := FormatUTF8(PUTF8Char(FormatSQLWhere), [], BoundsSQLWhere);
  if Client.Services['RemoteSQL'].Get(Query) then
  try
    Query.Execute(aSQL, False, False);
    Result := True;
  except
    Result := False;
  end;
end;

Iused  delphi 2007    zeosdbo 7.2  mysql 5.6   windows 7

Last edited by vga (2017-02-17 07:46:03)

Offline

#3 2017-02-17 07:56:13

sonadorje
Member
Registered: 2016-12-20
Posts: 13

Re: Memory usesed by mormot Server increasing all time when client runing

you should upload your full code to a public web eg. http://code.google.com
so we can analyze it together!

Offline

#4 2017-02-17 07:57:38

vga
Member
Registered: 2016-08-18
Posts: 15

Re: Memory usesed by mormot Server increasing all time when client runing

thank you,

on server, set:

Props.UseCache := False;

OK

Last edited by vga (2017-02-17 07:58:53)

Offline

#5 2017-02-17 11:04:13

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 336

Re: Memory usesed by mormot Server increasing all time when client runing

The memory grow because the sql statement is different in each execute, then the cache store it, when you deactivate the cache no store it.

You must build the sql statement this way:

   // aSQL = 'update t_data set Dat=?,PostTime1=?,s1=2 where Data_ID=?'
   if Query.Execute(aSQL, [], [Data,now,Data_ID]) then
...

Regards.

Esteban


Esteban

Offline

#6 2017-02-17 12:04:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,232
Website

Re: Memory usesed by mormot Server increasing all time when client runing

Why not use SynDBRemote for this actual remote access?
It is more optimized than an interface-based service...

See https://synopse.info/files/html/Synopse … l#TITL_131

Offline

#7 2017-02-21 08:30:37

vga
Member
Registered: 2016-08-18
Posts: 15

Re: Memory usesed by mormot Server increasing all time when client runing

thank you.
I'll try

Offline

Board footer

Powered by FluxBB