EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Sftp (7.0.155) - Memory Leak

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#10023
Posted: 05/14/2009 09:06:42
by Eugene Marmiy (Basic support level)
Joined: 05/06/2009
Posts: 26

2th tabpage


#10026
Posted: 05/15/2009 06:11:45
by Eugene Marmiy (Basic support level)
Joined: 05/06/2009
Posts: 26

Do You will answer?
#10027
Posted: 05/15/2009 06:59:31
by Ken Ivanov (EldoS Corp.)

CleanupRegisteredGlobalObjects() must be *the last* SBB function called from your code. It is not correct to call it from the handler of OnCloseQuery event of the form, as TElSimpleSFTPClient component is still alive at this time. Its destructor may recreate several of the global objects when the component is destroyed.
#10028
Posted: 05/15/2009 08:00:34
by Eugene Marmiy (Basic support level)
Joined: 05/06/2009
Posts: 26

Has transferred in:
Code
procedure TfrmMain.FormDestroy(Sender: TObject);
begin
  SBUtils.CleanupRegisteredGlobalObjects();
end;


The same result, has not changed
#10029
Posted: 05/15/2009 08:53:13
by Eugene Marmiy (Basic support level)
Joined: 05/06/2009
Posts: 26

Please, set an example(source) where the program will work stably, without memory leak
#10035
Posted: 05/16/2009 06:14:37
by Ken Ivanov (EldoS Corp.)

The ElSimpleSFTPClient component, as it is placed on the form, is still alive when OnDestroy event is fired.

To eliminate the "leaks" (as I said, they are not the leaks actually) you should
a) add ClearFileList() call to the OnDestroy event handler,
b) call CleanupRegisteredGlobalObjects() from the finalization section of the application.
#10041
Posted: 05/18/2009 02:08:07
by Eugene Marmiy (Basic support level)
Joined: 05/06/2009
Posts: 26

I have followed to your instructions and have made so:
Code
procedure TfrmMain.FormDestroy(Sender: TObject);
begin
  if SftpClient.Active then
  begin
    SftpClient.Close();
  end;
  FreeAndNil(FKeyStorage);
  ClearFileList;
end;

initialization

SetLicenseKey(...);

finalization
  SBUtils.CleanupRegisteredGlobalObjects();


The error remained the same.


#10064
Posted: 05/19/2009 10:23:10
by Ken Ivanov (EldoS Corp.)

I have no idea why your profiling application reports such a leak (we test the implementation periodically against several memory profiling tools and never had such a leak being detected).

Even if the reported leak is really there (under certain conditions, particular environments or other specific cases; as well as if our profiling applications had accidentally missed it), you may simply ignore it. The mentioned objects (TElWin32ProviderInfo) do exist until the application terminates. There's no sense in releasing them forcibly right before the application exits, as the operating system frees all the allocated memory itself when the process is destroyed.

We will also re-check the implementation with another profiling tool just to be confident that the code is clean.
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 5806 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!