Page 1 of 1

work with PostgreSQL memleak on server after 3936

Posted: 24.10.2016, 10:44
by alexs75
if TransactIsolationLevel:=tiNone;
mem leak on server
in this code:

Code: Select all

procedure TZPostgreSQLConnection.StartTransactionSupport;
..
  if Assigned(FUnpreparableStmts) then begin
    for x := FUnpreparableStmts.Count - 1 downto 0 do begin
      SQL := 'DEALLOCATE "' + {$IFDEF UNICODE}UnicodeStringToASCII7{$ENDIF}(FUnpreparableStmts.Strings[x]) + '";';;
      QueryHandle := GetPlainDriver.ExecuteQuery(FHandle, Pointer(SQL));
      CheckPostgreSQLError(nil, GetPlainDriver, FHandle, lcExecute, SQL,QueryHandle);
      GetPlainDriver.PQclear(QueryHandle);
      DriverManager.LogMessage(lcExecute, ConSettings^.Protocol, SQL);
      FUnpreparableStmts.Delete(x);
    end;
  end;
...
procedure StartTransactionSupport never called - server recourses not deallocated

Re: work with PostgreSQL memleak on server after 3936

Posted: 24.10.2016, 20:09
by marsupilami
Hello alexs75,

thank you for reporting that. Duh - the problem here is - does PostgreSQL even support tiNone? Or will it silently apply some kind of transaction control of its own? Something like tiReadCommitted with Autocommit on or something similar?
Currently I lean towards raising an exception if somebody cooses tiNone with PostgreSQL because I can't imagine for PostgreSQL to support something like this...

With best regards,

Jan

Re: work with PostgreSQL memleak on server after 3936

Posted: 25.10.2016, 06:27
by alexs75
Zeos not true works ReadCommited mode. See http://zeoslib.sourceforge.net/viewtopi ... 041#p77041

Re: work with PostgreSQL memleak on server after 3936

Posted: 25.10.2016, 20:35
by marsupilami
It does, but I will answer that in the other thread ;)