You are not logged in.
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
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
you should upload your full code to a public web eg. http://code.google.com
so we can analyze it together!
Offline
thank you,
on server, set:
Props.UseCache := False;
OK
Last edited by vga (2017-02-17 07:58:53)
Offline
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
Why not use SynDBRemote for this actual remote access?
It is more optimized than an interface-based service...
Online
thank you.
I'll try
Offline