Problem with Java Heap Space using Socket
I have a Server in Java using Socket and ServerSocket and a client. Well, the communication is perfect. The server must send about 35 - 300 packets per second. Well, when the process is working about 4 or 5 hours, the server goes down with an error: OutOfMemoryError: Java heap Space. How can i solve this problem? I know that its a virtual memory issue and i know how to increase it but the problem will persist some hours later if i increase it.
Does anyone know any technic?
Thanks in advance.