The problem is you are using NIO without Selector.
NIO without Selector is ok to use but then Channel.receive would be constantly trying to read which would show up as high CPU usage for one thread.
There are 2 solutions :-
- Use Selector to detect if there is something to read. Call channel.receive only when Selector indicates there is data to be read
- Use java.net.DatagramSocket/DatagramPacket to send/receive in blocking mode.