Results 1 to 4 of 4
- 08-19-2009, 12:40 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
Problem with Java Heap Space using Socket
Hi,
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.
- 08-19-2009, 01:17 PM #2
Using JProfiler,you can check which part of code is taking more memory and we can do some correction related to our design.If not,let me think some other option and tell you.
Ramya:cool:
- 08-19-2009, 01:54 PM #3
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
Hi RamyaSivakanth,
Thanks for your reply. I will check JProfile to learn how to use it.
By now, i have running the Server with the client connected and sending packets continuosly watching with Runtime.freeMemory() the virtual memory available and i can see that the memoria start decreasing from 70Mb to 60Mb and suddently it recover back, so it seems that works fine but not.... we have to wait for 4 hours to see how the memory down to almost 0 bytes free.
The sever alway has the same work.
- 08-21-2009, 04:45 AM #4
The garbage collector will wait until a certain amount of the heap is in use and then reclaim old objects to get the heap space back, so having the heap space drop and then restore is normal.
On the other hand, 60 - 70 MB is not much memory, especially for a server. I provide 512 MB just to run Netbeans or Eclipse. While dwindling memory indicates a memory leak, if you don't provide a large enough heap, you may simply not have enough heap for your server to run, especially when it is handling so many transactions.
What are your heap settings?
Similar Threads
-
Java heap space OutofMemoryError
By everlast88az in forum Advanced JavaReplies: 3Last Post: 05-18-2009, 08:12 AM -
[SOLVED] Java heap space OutOfMemoryError
By loki in forum New To JavaReplies: 14Last Post: 04-25-2009, 04:11 PM -
Java Heap Space
By sandeeprao.techno in forum Advanced JavaReplies: 19Last Post: 10-30-2008, 11:27 AM -
Java heap space error
By gezzel in forum New To JavaReplies: 19Last Post: 09-25-2008, 12:07 AM -
Java heap space?
By javanewbie in forum New To JavaReplies: 1Last Post: 06-24-2008, 06:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks