aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes java.lang.OutOfMemoryError in Socket Programming in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "java.lang.OutOfMemoryError in Socket Programming in Java" Watch "java.lang.OutOfMemoryError in Socket Programming in Java" New topic
Author

java.lang.OutOfMemoryError in Socket Programming in Java

Kaushik Mehta
Greenhorn

Joined: Feb 10, 2003
Posts: 4
Hi,
I ve a program which starts 2 threads. One thread opens a server socket that listens for any clients to connects to it. Once a client connects it would read whatever the client sends to it and then some processing is done and reply is sent thru the other thread. My problem is keep getting this error sometime after the program starts running. I first thought this might be due to improper creation and destroying of objects. But this error crops up even when there are no client connections(I create other objects only when a client connects. before that only 2 theads are created). So even if the Server Socket just keeps listening for client connections, after sometime this message crops up and no further clients can connect. Please help me.
Thanks in advance,
Kaushik
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Hi,
Maybe you could show us some code. WHen there are no clients, the server should just be stuck at a call to "accept()," and this shouldn't be using any resources as all.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.OutOfMemoryError in Socket Programming in Java
 
Similar Threads
Storing Socket object in database
quick question
Shutting down a server
Cleaning up after a Multi-threaded Server
Design question