Hi all!
It's come to our attention that there is a bug in Java that could lead to a deteriorating performance. Users are encouraged to update their Java version to the latest Java 8. Any version of Java 8 prior to 102 is affected! The extent of Java 7 hasn't been resolved, but it does affect Java 7 as well!
Here's a test Java program to see if you wish to see if you're affected. To use, save it into a text file (QueueTest.java), navigate to the folder on a command line, run javac QueueTest.java
, then java QueueTest
If you are affected, each row of output should take longer to produce. If you are unaffected, lines of output should come pouring out with nearly constant times (CTRL + c to terminate!)
import java.util.concurrent.ConcurrentLinkedQueue;
public class QueueTest {
public static void main(String[] args)
{
ConcurrentLinkedQueue<Object> queue = new ConcurrentLinkedQueue();
queue.add(new Object()); //Required for the leak to appear.
Object object = new Object();
int loops = 0;
long last=System.currentTimeMillis();
while(true)
{
if(loops%10000==0)
{
long now = System.currentTimeMillis();
long duration = now - last;
last=now;
System.err.printf("loops=%d duration=%d%n", loops, duration);
}
queue.add(object);
queue.remove(object);
++loops;
}
}
}