You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Todd Brewer <tb...@knowlysis.com> on 2005/12/06 18:47:22 UTC

[COMMONS.NET.FTP] How to resolve an Out of Memory Error on connect

I am getting the following error message, just by trying to connect to an
FTP server:
 
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new
native thread
 at java.lang.Thread.start0(Native Method)
 at java.lang.Thread.start(Unknown Source)
 at
org.apache.commons.net.telnet.TelnetInputStream._start(TelnetInputStream.jav
a:97)
 at
org.apache.commons.net.telnet.TelnetClient._connectAction_(TelnetClient.java
:104)
 at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:328)
 at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:550)
 at org.apache.commons.net.SocketClient.connect(SocketClient.java:163)
 at org.apache.commons.net.SocketClient.connect(SocketClient.java:250)
 at FTPUtils.main(FTPUtils.java:25)
 
My code is very simple:
 
   try 
   {
       FTPClient ftp = new FTPClient();    
        <ftp://ftp.connect(> ftp.connect("ftp.download.com");
   } 
   catch (exception e) 
   {
       e.printStackTrace();
   }
   System.out.print( <ftp://ftp.getReplyString> ftp.getReplyString());
 
 
The error occurs on the ftp.connect() line.  
 
I am using Java 1.5.0_04, but have verified the same error on 1.3.1_16.  I
am using Eclipse on Windows XP.  I have tried changing some of the memory
parameters, with no luck.
 
Any help in resolving this would be appreciated!