Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.6k views
in Java FTP by (120 points)
Hello,
I used edtFtpj/Free library to upload a file to FTP server.
I worte a very simple code (just login and upload a small file and disconnect) as in the example source code.
I put the binary into my phone (Android OS. 4.04).
But, whenever my program upload the small file (40bytes) to the FTP sever, the memory of my app is increased by 0.1MB.
I need to upload that file every 1 minutes. After several hours, the memory leak becomes serious.
Is this a bug? Or did I make some mistake? Here is my code.
Please help me.. Thanks in advance..

FileTransferClient ftp= new FileTransferClient();
String host = "my host server name";
String userId = "my user id";
String passwd = "my password";
String fileName = "my file to transfer";

try
{
while(true)
{
ftp.setRemoteHost(host);
ftp.setUserName(userId);
ftp.setPassword(passwd);

ftp.connect();

ftp.uploadFile(fileName, fileName);

ftp.disconnect();

sleep(60*1000);
}
}
catch (Exception e)
{
}

1 Answer

0 votes
by (162k points)
It's possible there's a memory leak there somewhere. We're not aware of one though.

Why don't you print out the memory details for each iteration and post a few iterations?

Categories

...