Memory Utilization (wodSFTP / wodSFTP.NET / wodSFTPdll)
Dear all,
I'm developing a kind of 'message-broker' application which logs in on different FTP-servers for more than 1000 times a day. I'm using the wodFtpDLX-component for this. I'm experiencing a very big problem with the application: after the start it uses about 30MB of memory, in a few hours it is increased to about 200MB.
With the debugger I found that the memory is increased every time I call the LISTDIR method (which calls a POPULATETREE(item als DirItems) method).
Even with the following code in POPULATETREE the used memory is increased:
For i = 0 To Items.Count - 1
If Items(i).Type = typeFile Then
'do nothing
end if
Next
The component is shipped with an example-project (c:\Program Files\WeOnlyDo.Com\FtpDLXSamples\VB\Component\2. Folder Tree). On this application I added a timer which presses the connect and disconnect buttons every second. With the taskmanager in sight you can see the memory-usage growing.
Please, what can I do with this problem?
Thank you,
regards,
Rien van Ham
Re: Memory Utilization
Hi Rien,
I have just finished testing and didn't find any significant memory leak with 2. Folder Tree sample.
When I remove:
TreeView1.Nodes.Add AtNode.Key, tvwChild, _ & MyKey, a
line from my code I find some memory leak but I think this has to be something wilt TreeView object (buffering) because when I change line to this:
TreeView1.Nodes.Add AtNode.Key, tvwChild, _ & MyKey,
then I don't have memory leak.
I have also tried same routing on new sample without TreeView and didn't find any memory leak. In my tests I start ListDir Method in loop every 20 seconds for about 30 minutes.
In order to duplicate your issue we will need more info. Which server you are using? Which protocol? Passive or non passive mode if you are using FTP protocol. How many files, folders is in folder you are listing?
Hope I helped.
Regards,
Drazen
Re: Memory Utilization
Hi Drazen,
I did some extensive testing with my application and found the following:
I'm using the LISTDIR method.
It fires the DONE event which calls the PopulateTree method:
Private Sub objFTPOphalenNieuw_Done(ByVal ErrorCode As Long,
ByVal ErrorText As String)
PopulateTree objFTPOphalenNieuw.DirItems
End Sub
IF PopulateTree contains NO code:
Private Sub PopulateTree(ByVal Items As DirItems)
End Sub
NO memoryleak is present in the application.
But, if a put the following code in this method:
Private Sub PopulateTree(ByVal Items As DirItems)
Dim intTeller as Integer
For intTeller = 0 To Items.Count - 1
Next intTeller
End Sub
the application starts leaking memory:
at start it uses: 12.224 MB
after 1 min.: 14.552 MB
after 2 min.: 15.128 MB
after 3 min.: 15.648 MB
after 4 min.: 16.184 MB
etc.
==========================================================
Used FTP-server (on localhost): Serv-U 6.4.0.6
Files present in sourcedirectory: 429, 7 MB
The only thing my testapplication does at this moment is logging in at the server and getting the filelist.
Thanks a lot,
Rien van Ham
Re: Memory Utilization
Rien,
Is there any chance that you can zip and send your sample to: techsupport@weonlydo.com ?
I'm unable in duplicating your issue. Also tell us how many files (number) you have in that folder.
Drazen
Re: Memory Utilization
Hello Drazen,
The code was sent to you by email.
Oh yes, the number of file on the ftp-server: 429 (about 7 MB).
Thanks,
Rien.
Re: Memory Utilization
My problem is solved!!
Compliments for you all guys that you solved the problem in such a short time! Thank you very, very much.
Regards,
Rien