Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Nio 100% cpu issue

843790Aug 23 2010 — edited Aug 8 2011
Hello everybody,

first of all I want to apologize if this topic looks like a repost of some other issue, but I did not found any suitable solution to my issue in the forum search.

So lets come to my problem. I'm using Java NIO to run my server application which is holding long-time tcp connections, it is quite similiar to the ROX NIO Tutorial you can find here: [http://rox-xmlrpc.sourceforge.net/niotut/]
Everything is running fine, but after some time usually it happens after 2 or 3 days my server stucks which means the java process seems still running but consuming 100% cpu, doesnt log anything to my logfile and is not printing anything to StdOut & StdErr. If I watch my open files with lsof -Pi I see atleast one client which is connected to the server in TCP state (CLOSE_WAIT). If I try to connect a new client it simply disconnects after some timeout. So it seems that the server is not reachable anymore. If I restart the program (server) everything runs fine until it getting stuck again after some time.

As an environment I use Linux version 2.6.26-2-amd64 (Debian 2.6.26-19) and java -version shows me the following:
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

I already tried different older java versions but the error still remains. I also used the 64 and 32 bit version without any succes. I quite helpless at the moment so it would be nice if someone could help me in that case.

Thanks in advance.
Chris.

Edited by: SiRiuS81 on Aug 23, 2010 9:59 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2011
Added on Aug 23 2010
12 comments
2,189 views