avoiding OutOfMemoryException
I have developed a project.It's based on client server architecture.the server is initiating properly.Client also connecting properly.But the problem is that server writes some data to the socket when client reads the data it generates an exception called "java.lang.outofmemoryexception:Java heap space".Moreover it generates this exception sometimes only not all times.How can I get rid of this exception.I am running my project through command prompt.
Re: avoiding OutOfMemoryException
See the following: http://www.javaprogrammingforums.com...html#post20021
I presume this exception is happening client side, in which case adding the -xmx parameter would resolve the problem, but you should make sure the program doesn't hold onto references that are not necessary to avoid the exception in the first place.
Re: avoiding OutOfMemoryException
Quote:
Originally Posted by
copeg
See the following:
http://www.javaprogrammingforums.com...html#post20021
I presume this exception is happening client side, in which case adding the -xmx parameter would resolve the problem, but you should make sure the program doesn't hold onto references that are not necessary to avoid the exception in the first place.
I have tried that before only.But i cant get rid of that problem.Moreover the data that reads from the socket is not huge data.Its only number data.just Two numbers are read.
Re: avoiding OutOfMemoryException
Hard to offer solutions without code to see what is happening. Can you make a SSCCE that demonstrates the problem?