Random in Java
Just debugging some Java over the weekend and one thing that floated around was that using STRACE on various Java threads produced output that had the error:
EAGAIN (Resource temporarily unavailable)
Poking around there is a bug open with Sun about how Java produces random numbers on JDK 1.4. Looks like it reads in the /jre/lib/security/java.security file to determine which file on the operating system to get random numbers from. On Linux this is /dev/random. /dev/random has the possibility of becoming empty because it is essentially a list of random numbers produced by watching various system resources. The solution appears to be to change the value in the security file to use urandom instead. The changes would look like this:
securerandom.source=file:/dev/urandom
/dev/urandom is will use /dev/random unless it is empty in which case it will use a pseudo-random number algorithm. Here is the bug for it:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705093
This entry was posted
on Monday, August 15th, 2005 at 3:33 pm and is filed under Java.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.