aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes CPU usage goes to 100% Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "CPU usage goes to 100%" Watch "CPU usage goes to 100%" New topic
Author

CPU usage goes to 100%

Karup Mew
Ranch Hand

Joined: Aug 11, 2007
Posts: 40
Hi All,

when I try to regeistering the clients through register method of SocketChannel class sometimes its occupy the cpu memory full suddenly sytem hangs. I dont why its happened Kindly sove this problem if anybody knows the solution.
[ December 08, 2008: Message edited by: Karup Mew ]
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Does this run in a loop?

With nothing to block, of course it is going to take all your CPU time since it never rests.


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Karup Mew
Ranch Hand

Joined: Aug 11, 2007
Posts: 40
Originally posted by Rusty Shackleford:
Does this run in a loop?

With nothing to block, of course it is going to take all your CPU time since it never rests.


Yes this is running in a loop
robin singal
Ranch Hand

Joined: Jul 18, 2007
Posts: 102
Just add a few microseconds sleep to the thread which is in while loop. You will see the difference.


Life is short play hard.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: CPU usage goes to 100%
 
Similar Threads
Using NIO for Client Sockets
SocketChannel and FileChannel
CPU Usage and NIO
nio and http request
SocketChannel and OutputStream