Java IOException: No buffer space available while sending UDP packets on Linux -


I have a third party component which, in a certain position, tries to send many UDP messages to many different addresses It is a burst, which happens when the software is started and the situation is temporary. I'm not sure whether this is a fair amount of messages or the fact that each of them goes to a different IP address.

Nevertheless, changing the underlying protocol or problematic component is not an option, so I'm looking for a workaround. StackTrace looks like this:

  java.io.IOException: No buffer space available on java.net.PlainDataagramSocketImpl.send (at the native resident method) on java.net.DatagramSocket.send (DatagramSocket. Java: .612) This problem occurs because of (at least) Java version 1.6.0_13 and 1.6.0_10 and Linux versions with Ubuntu 9.04 and RHEL 4.6 

< P> Is there any Java system properties or Linux configuration tweaks that can help?

I have finally determined what the problem is Java IOException is misleading because this "buffer space is not available "But the root problem is that the local ARP table is loaded on Linux, viewing the default ARP table 1024 (files / proc / sys / net / ipv4 / neighbors / default / gc_thresh1, / proc / sys / net / ipv4 / neighbors / Default is / gc_thresh2, / proc / sys / net / ipv4

What was happening in my case (and I This is the case), that your Java code is sending UDP to an IP address that is in the same subnet when your destination address occurs, then the Linux machine IP address to translate the hardware into the MAC address, the ARP lookup Since you are destroying the packet for many different IPs, the local ARP table is quickly filled up, 1024 hits, and when the Java exception is thrown.

Even Paddy is simple, either by increasing the limit by editing I have mentioned before, or after transferring your server from your destination address to a different subnet, due to which the Linux box has the neighboring ARP lookup (instead managed by a router on the network Will not have performed).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -